You are not logged in.
Pages: 1
my code is
program UTF8Test;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
SynCommons;
var
AJSON: TJSONWriter;
AUTF8Text,
AUTF8Result: RawUTF8;
begin
try
AJSON := TJSONWriter.CreateOwnedStream;
try
AUTF8Text := '한글(Korean), 日本語(Japanese) Test';
AJSON.Add('{');
AJSON.AddFieldName('utf8');
AJSON.AddJSONEscape(Pointer(AUTF8Text));
AJSON.Add('}');
AUTF8Result := AJSON.Text;
finally
AJSON.Free;
end;
Writeln(AUTF8Result);
Readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
result:
{"utf8":﨑懋ク'#$80'(Korean), 譌・譛ャ隱・Japanese) Test}
how can i do?
Offline
Pages: 1