blast007 / nls-game-engine

Automatically exported from code.google.com/p/nls-game-engine
0 stars 0 forks source link

New JSON-formatted log doesn't escape special characters #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Repro:
1. Call LOG() with a message containing quotes, backslashes, etc.
2. Load log file.
3. Test against JSONLint.

It is expected that the embedded special characters be escaped using the 
backslash escape character, as per the string type declaration on 
http://www.json.org/.  Instead they are embedded directly, breaking formatting 
rules.

Original issue reported on code.google.com by kf6...@gmail.com on 25 May 2012 at 4:12

GoogleCodeExporter commented 9 years ago
Fixed by adding a message cleaning block. The block now strips any trailing 
newlines, and escapes various characters according to the string section on 
http://www.json.org .

Original comment by adam.madram on 13 Jul 2012 at 6:10