In the JSON spec, what does "Since the first two characters of a JSON text will always be ASCII characters" mean?

Posted by dan gibson on Stack Overflow See other posts from Stack Overflow or by dan gibson
Published on 2010-11-20T10:07:04Z Indexed on 2012/11/09 23:00 UTC
Read the original article Hit count: 217

Filed under:

The spec is http://www.ietf.org/rfc/rfc4627.txt?number=4627 It contains this:

  1. Encoding

    JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.

    Since the first two characters of a JSON text will always be ASCII characters [RFC0020], it is possible to determine whether an octet stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking at the pattern of nulls in the first four octets.

What does it mean "Since the first two characters of a JSON text will always be ASCII characters [RFC0020]"? I've looked at RFC0020 but couldn't find anything about it. JSON could be {" or { " (ie whitespace before the quote.

© Stack Overflow or respective owner

Related posts about JSON