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

RFC 4627 on Json reads:

  • Encoding

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

    Since the first two characters of the JSON text will always be ASCII characters [RFC0020], you can determine if the octet is UTF-8, UTF-16 (BE or LE) or UTF-32 (BE or LE) by searching for zeros in the first four octets.

What does it mean, "Because the first two characters of the JSON text will always be ASCII characters [RFC0020]"? I looked at the RFC0020 but couldn't find anything. JSON can be {"or {" (i.e. the space before the quote).

+3
source share
1 answer

, , JSON ASCII (-ASCII , ), / , .

UTF-16 UTF-32 , , , , , . , , JSON .

, /, ( , ).

+6

Source: https://habr.com/ru/post/1775954/


All Articles