Loading ...
Sorry, an error occurred while loading the content.

Re: Unrecognized escape sequences -- what is proper parser behavior?

Expand Messages
  • Douglas Crockford
    ... The ! is not strictly JSON, so a parser is free to do what it wants with it. Some reasonable options would be treat it as ! treat it as ! treat it as a
    Message 1 of 2 , Mar 20, 2006
    View Source
    • 0 Attachment
      > Given the following string:
      > { "parent": { "child": "Hello\!" } }
      > And asking a JSON parser to parse it, what is the expected behavior?

      The \! is not strictly JSON, so a parser is free to do what it wants
      with it. Some reasonable options would be

      treat it as !
      treat it as \\!
      treat it as a syntax error
    Your message has been successfully submitted and would be delivered to recipients shortly.