Guide: Unicode escapes (\u): encode and decode
When to use it
When you need text with accents or emoji in a file that only supports ASCII, or want to read a JSON string full of \uXXXX.
Tips
- By default only what is not ASCII is escaped; turn on the option to escape everything.
- Emoji and other large characters are written as a surrogate pair (\uD83D\uDE00) or with braces.
- When decoding, \uXXXX, \u{X} and U+XXXX are understood.
Frequently asked questions
What is a surrogate pair?
A way to write characters outside the basic plane with two 16-bit units, as JavaScript does.