Closed dreammaker closed 8 years ago
Should be a straightforward change to the parse_string
function (https://github.com/JuliaLang/JSON.jl/blob/fe9de2d226619ea52510479bc30b9acaad77628d/src/Parser.jl#L142). What characters exactly does the standard permit?
http://www.json.org/ suggests "anything but control characters, "
, and \
"
Which suggests that JSON is actually doing this right. It seems unreasonable for the package to refuse any syntax that any JSON parser anywhere happens to refuse.
Oh, does a literal newline count as a control character? In that case, I guess this should be an error.
The ECMA standard is a lot clearer: All characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark (U+0022), reverse solidus (U+005C), and the control characters U+0000 to U+001F
This is definitely fixed by #140, but I messed up the autoclose so GitHub did not close it. Good to close? @dreammaker @kmsquire
Closed by #140.
Parsing a newline character in a string should be an error, according to the standard and the parsers in basically all other languages. Using JSON 0.4.6 I get this:
This has caused us some problems. We thought our JSON was valid since the Julia JSON package parsed it, but it hasn't been.