procedure TForm1.Button1Click(Sender: TObject);
const
cSample = 'Fisch'+#9;
var
s: string;
begin
s := McJSONEscapeString(cSample, jetNormal);
Memo1.Lines.Add('MC: "'+s+'"');
s := McJSONUnEscapeString(s);
if s <> cSample then Memo1.Lines.Add('MC error!')
else Memo1.Lines.Add('MC OK!');
s := StringToJSONString(cSample);
Memo1.Lines.Add('FP: "'+s+'"');
s := JSONStringToString(s);
if s <> cSample then Memo1.Lines.Add('FP error!')
else Memo1.Lines.Add('FP OK!');
end;
Result:
Memo1
MC: "Fisch\ "
MC error!
FP: "Fisch\t"
FP OK!
Hi!
I'v found small error in the new function:
Result: