kbmMWDebug and UTF16 String in StamtService result

Home Forums kbmMW kbmMWDebug and UTF16 String in StamtService result

Viewing 2 reply threads
  • Author
    Posts
    • #55748
      VadimMest
      Participant

      Hello.

      SmartService

      [kbmMW_Rest(‘method:post, path:getdocrow’)]
      [kbmMW_Method]
      function GetDocRow: string;

      function TMTRESTService.GetDocRow: String;
      var jsonIn, jsonOut: TkbmMWJSONObject;

      …..
      Result := jsonstreamer.SaveToUTF16String(jsonOut);

      end;

      The client and the server works, but kbmMWDebug writes ?????

      Result: 1-<Ustring>'{“data”:[{“id”:207,”idlabel”:24223,”quantity”:84,”quantityfact”:74,”price”:5.4,”fullname”:”?????? ???-???? 51?76 \”STICK’N ?????\” ??????? 100? CREATIVE GROUP 21145″,”code”:”29459″,”barcode”:”4605246003561″,”iscorrect”:0}]}’

      How can I fix it?

      Thanks

      Vadim Mescheryakov

      • This topic was modified 4 years, 7 months ago by VadimMest.
    • #55750
      kimbomadsen
      Keymaster

      Hi,

      It is probably because your debug output has been set to mwddRawTextFile or mwddOneRawTextFile. Then it will assume the string to be ASCII only.

      You can search for the line:
      bs:=TEncoding.ASCII.GetBytes(s);
      (roughly line 2940 ish in kbmMWGlobal.pas)

      and replace it with TEncoding.UTF8.GetBytes(s);

      Then it will output the debug in UTF8.

      I will make a change in kbmMW to include kbmMWDebugEncoding:TEncoding (default ASCII) which can be used to set the encoding.
      /Kim

    • #55774
      VadimMest
      Participant

      Thanks!

       

Viewing 2 reply threads
  • You must be logged in to reply to this topic.