Unicode in JSON: Encoding, BOM, and Emoji Support
Unicode in JSON: UTF-8 encoding, BOM handling, emoji support, and \uXXXX escape sequences. How parsers handle multi-byte characters and surrogates.
Published:
Tags: json, developer-tools, beginner
Unicode in JSON: Encoding, BOM, and Emoji Support JSON was designed to work with the full range of human language from the start. The specification (RFC 8259) requires that JSON text be encoded in Unicode. In practice, this means you can store names, addresses, and messages in any language, and emoji work just fine too. But there are a few encoding concepts worth understanding: which Unicode encoding to use, what the BOM is and why it causes problems, and how the escape sequence works for characters that need special handling. UTF-8, UTF-16, and UTF-32 These three are encoding schemes for Unicode. They each represent code points as different numbers and sizes of bytes. UTF-8 uses 1 to 4 bytes per character. ASCII characters (code points U+0000 through U+007F) use exactly 1 byte — the same…
All articles · theproductguy.in