Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode escaping in strings is not parsed correctly #102

Open
vschoettke opened this issue Nov 27, 2017 · 0 comments
Open

unicode escaping in strings is not parsed correctly #102

vschoettke opened this issue Nov 27, 2017 · 0 comments

Comments

@vschoettke
Copy link

Jsonlint does not parse strings with unicode escape characters correctly. Instead of parsing the unicode \uXXXX it's escaping it, so the resulting string is wrong.

e.g.: parsing '{\n"name": "\\u30d0\\u30b0"\n}\n' results in { name: '\\u30d0\\u30b0' } but should be { name: '\u30d0\u30b0' }

Here is the code to reproduce the error:

var jsonlint = require("jsonlint");
var test = '{"name": "\\u30d0\\u30b0"}';
var jsonlintRes = jsonlint.parse(test);
var jsonparseRes = JSON.parse(test);
console.log("PARSE SAME?", jsonlintRes === jsonparseRes);
console.log("jsonlint result:", jsonlintRes);
console.log("JSON.parse result:", jsonparseRes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant