hydrobyte / McJSON

A Delphi / Lazarus / C++Builder simple and small class for fast JSON parsing.
MIT License
58 stars 20 forks source link

MCJsonUnEscapeString "/" and "\" missing after unescape #15

Closed totyaxy closed 1 year ago

totyaxy commented 1 year ago

Hi!

Very thank you fro the new valuable functions, but I found a little error:

procedure TForm1.Button1Click(Sender: TObject);
var
  s: string;
begin
  s:='A / B';

  Memo1.Lines.Add(s);
  s:= MCJsonEscapeString(s);
  Memo1.Lines.Add(s);
  s:= MCJsonUnEscapeString(s);
  Memo1.Lines.Add(s);

  s:='A \ B';

  Memo1.Lines.Add(s);
  s:= MCJsonEscapeString(s);
  Memo1.Lines.Add(s);
  s:= MCJsonUnEscapeString(s);
  Memo1.Lines.Add(s);
end;                

result:

Memo1
A / B
A \/ B
A  B
A \ B
A \\ B
A  B

"/" and "\" is missing after unescape.

hydrobyte commented 1 year ago

Hi.

I'll fix this error.

totyaxy commented 1 year ago

Hi!

Thank you, seems to me now it works correctly. Your test app: "all test passed".

This post of mine is somewhat related to this: https://github.com/hydrobyte/McJSON/issues/13#issuecomment-1459807665

hydrobyte commented 1 year ago

Hi.

I'll take a look at #13.