Skip to content

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

Closed

Description

@rockeet

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

Activity

  1. nlohmann commented on Dec 6, 2015

    @nlohmann
    Owner

    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)

  2. nlohmann commented on Dec 6, 2015

    @nlohmann
    Owner

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

  3. rockeet commented on Dec 10, 2015

    @rockeet
    Author

    Cool, it works!

  4. nlohmann commented on Dec 10, 2015

    @nlohmann
    Owner

    \o/

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions