Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] Saving json strings with a backslash do not load properly in some cases

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 5th Dec 2018 08:38
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 5th Dec 2018 10:31
Definitely a bug, The json file is saved as

Which is correct. It seems that when loading, the parser correctly parses the \\ as a backslash, but the input is advanced only one character instead of 2, so the next token read is \t, which is converted to a tab character, instead of reading just the t.

Tried changing the string to "\mony", works correctly. Try changing it to "\nony", parses incorrectly. Seems that the bug only appears when the second backslash and the character following makes a valid escape sequence.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Dec 2018 23:08
Thanks, fixed. Unfortunately it didn't make it into the next version, but it will be in the version after.

Login to post a reply

Server time is: 2024-03-29 15:24:29
Your offset time is: 2024-03-29 15:24:29