~/code/NeatJSON/test$ lua test_neatjson.lua
neatJSON("foo\9bar")
EXPECTED
"foo\tbar"
ACTUAL
"foo\9bar"
neatJSON("foo\13bar")
EXPECTED
"foo\rbar"
ACTUAL
"foo\13bar"
neatJSON("foo\8bar")
EXPECTED
"foo\bbar"
ACTUAL
"foo\8bar"
neatJSON("foo\12bar")
EXPECTED
"foo\fbar"
ACTUAL
"foo\12bar"
This is valid Lua escaping, but not valid JSON escaping. At a minimum need to convert \9 to \u0009 to be valid JSON; would be preferable to use the nicer escapes for \n\t\r\f.
This is valid Lua escaping, but not valid JSON escaping. At a minimum need to convert
\9
to\u0009
to be valid JSON; would be preferable to use the nicer escapes for\n
\t
\r
\f
.