thomh 0 Posted May 14, 2021 I am using the TJsonTextWriter to write my JSON string. Looking at the code I see this method which uses the WriteEscapedString method to escape the string. procedure TJsonTextWriter.WriteValue(const Value: string); begin inherited WriteValue(Value); if (Length(Value) = 0) and (EmptyValueHandling = TJsonEmptyValueHandling.Null) then Exit; WriteEscapedString(Value, True); end; But I cannot find an UnEscape JSON string method? Is there one? Thanks, Thom Share this post Link to post
0x8000FFFF 22 Posted May 14, 2021 var JSONValue := TJSONObject.ParseJSONValue('"multi\nline"'); Writeln(JSONValue.Value); JSONValue.Free; yields Quote multi line 1 Share this post Link to post
thomh 0 Posted May 16, 2021 On 5/14/2021 at 10:06 AM, 0x8000FFFF said: var JSONValue := TJSONObject.ParseJSONValue('"multi\nline"'); Writeln(JSONValue.Value); JSONValue.Free; yields Thank you. BTW, is there a method that you can use to unescape the whole JSON string and not just a certain value? // Thom Share this post Link to post
0x8000FFFF 22 Posted May 16, 2021 What do you mean, what is the difference between 'the whole JSON string' and 'a certaing value'? Can you name some examples? Share this post Link to post