- This topic has 2 replies, 2 voices, and was last updated 4 years, 7 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
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
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
Thanks!