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

Unescaped Unicode Characters Not Detected #47

Open
gsexton opened this issue May 27, 2014 · 2 comments
Open

Unescaped Unicode Characters Not Detected #47

gsexton opened this issue May 27, 2014 · 2 comments

Comments

@gsexton
Copy link

gsexton commented May 27, 2014

I had an app that was giving unterminated string constant exceptions in jQuery/Firefox and Illegal Character exceptions in jQuery/Chrome. I ran my JSON content through JSONLint and it reported the content as valid.

After looking into it, I found that my JSON had unescaped unicode characters (smart quotes).

I modified my code to escape unicode chars in the format \uxxxx and my app is now working.

So, it looks like jsonlint is passing as correct JSON content that has unicode and that's not correct.

@mattfenwick
Copy link

I'm interested in this issue as well 👍 -- @gsexton can you post an example of the problematic input?

@khepler
Copy link

khepler commented Sep 8, 2014

The JSON spec allows un-escaped Unicode characters other than " or \ or "control characters" in strings.

I ran into trouble once where the quotes surrounding strings were smart quotes, but that did not pass validation. And you wouldn't want to escape those anyway.

My guess is jQuery is not conforming to spec...?

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

3 participants