#1 2015-09-25 11:21:52

witya
Member
Registered: 2015-09-25
Posts: 5

Bug in StringToJSON with control character

Fix

if Text[i]<' ' then
      result := result+'\'+IntToHex(ord(Text[i]),4)

with

if Text[i]<' ' then
      result := result+'\u'+IntToHex(ord(Text[i]),4)

reference www.json.org

char
any-Unicode-character-
    except-"-or-\-or-
    control-character
\"
\\
\/
\b
\f
\n
\r
\t
\u four-hex-digits

string.gif

Offline

#2 2015-09-25 11:50:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Bug in StringToJSON with control character

Fixed by http://synopse.info/fossil/info/ebadc23bcc

Thanks for the patch!

Offline

Board footer

Powered by FluxBB