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

json::parse(string) does not check utf8 bom #152

Closed
rockeet opened this issue Nov 30, 2015 · 4 comments
Closed

json::parse(string) does not check utf8 bom #152

rockeet opened this issue Nov 30, 2015 · 4 comments

Comments

@rockeet
Copy link

rockeet commented Nov 30, 2015

Exception thrown when passing an utf8 string with starting bom to json::parse, it should skip the bom mark and treat the string as utf8

@nlohmann
Copy link
Owner

nlohmann commented Dec 6, 2015

I changed the label to "enhancement", because the current behavior is compliant:

Implementations MUST NOT add a byte order mark to the beginning of a JSON text. In the interests of interoperability, implementations that parse JSON texts MAY ignore the presence of a byte order mark rather than treating it as an error.

(see http://rfc7159.net/rfc7159#rfc.section.8.1)

@nlohmann
Copy link
Owner

nlohmann commented Dec 6, 2015

@rockeet, just to be sure - we are talking about the bytes EF BB BF? Could you provide an example that triggers the exception?

@rockeet
Copy link
Author

rockeet commented Dec 10, 2015

Cool, it works!

@nlohmann
Copy link
Owner

\o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants