Quick answer
Unicode assigns each character a code point such as U+4E2D. A JavaScript-style escape may be written as \u4E2D, while UTF-8 is a byte encoding used to store or transmit that character. These are related representations, not interchangeable strings.
How to do it
- Identify whether the input contains literal characters, \u escapes, code points, or encoded bytes.
- Convert escapes with support for surrogate pairs and supplementary characters.
- Render and copy the result only after checking that malformed sequences were reported.
Why some emoji use two escapes
JavaScript strings use UTF-16 code units. Characters above U+FFFF are represented by a high and low surrogate pair, such as two \uXXXX sequences. Splitting or reversing those units independently corrupts the character.
Unicode does not guarantee visual sameness
Different sequences can render identically, such as a precomposed accented letter and a base letter plus combining mark. Normalization may matter for comparison, identifiers, and security. Font support also determines whether a valid character appears as a glyph.
Common mistakes to avoid
- Confusing a code point with its UTF-8 byte sequence.
- Decoding arbitrary backslash escapes as executable code.
- Assuming one visible symbol always equals one string unit.
Try the related tool
Use QRFoundry directly in your browser. Tool inputs and uploaded files are processed on your device.
Open Unicode Converter