Closed stephanewierzbicki closed 8 years ago
Hello Onur,
Thank you for your commit. I've tested my code (using CreateWithEscape) and I'm getting this exception :
Exception 'first chance' à $7517DAD8. exception class TJSONSyntaxError with message 'Unexpected token ILLEGAL. (Line: 0 Col: 9)'. Process CRM.exe (416)
Hi Stephane, You have to use '=' instead of ':' for json field operator.
As a sample: TSuperObject.CreateWithEscape('{"adress":"My Adress'+#13#10+'My City"}');
I'm a noob... I did a typo.
I've tested CreateWithEscape but it still fails. I've have uploaded a JSON sample. You can reproduce it easily :
Procedure Load;
var X: ISuperObject;
SL:TStringlist;
begin
sl := TStringlist.create;
try
sl.LoadFromFile('D:\Formated.txt') ;
X:= TSuperObject.CreateWithEscape(sl.Text);
finally
sl.free;
end;
end;
Hello, I'm getting an exception when using line linefeed/linebreak in my JSON string : TSuperObject.Create('{"adress"="My Adress'+#13#10+'My City"}');
Is it possible to dynamically replace such special char with escape sequences ?
legitimate escape sequences within a JSON string: \" \ \/ \b \f \n \r \t \u followed by four-hex-digits