Description
Decode one braced scalar escape to a code point and character.
Unicode code points, UTF-16 units and UTF-8 octets are different representations. A local escape or byte check can report useful structure without establishing that an entire encoded string is well formed.
Decode one braced scalar escape to a code point and character.
When to use this tool
Use Decoding: ECMAScript Unicode Code Point Escape when inspecting the stated scalar, escape or byte-layout component.
How to use the tool and how it works
- Enter token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Decode one braced scalar escape to a code point and character. Require literal backslash-u braces with 1-6 hexadecimal digits and a valid Unicode scalar; return codepoint and String.fromCodePoint result.1
Unicode scalar values exclude surrogate code points. Code units, scalar values and encoded byte sequences are distinct representations.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Braced Unicode escape restricted here to Unicode scalar values; surrogate escapes accepted in some ECMAScript contexts are rejected. | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.codepoint | Numeric Unicode code point; distinguish code points from UTF-16 code units. | Calculated result member: number. |
| result.character | Character | Calculated result member: string. |
{
"input": {
"token": "\\u{1F600}"
},
"output": {
"result": {
"codepoint": 128512,
"character": "😀"
}
}
} Limitations and assumptions
- This rejects surrogate escapes allowed in some JavaScript source contexts and does not execute code.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a conforming complete decoder for strings and distinguish Unicode scalar validity from source-language or HTML error recovery.
References
-
Calculation and input contract: decode/ecmascript-unicode-code-point-escape — tool.io
-
Unicode 17.0: conformance and encoding forms — Unicode Consortium
Similar or alternative tools
- Unicode Escape Braced Digit Budget
Parse one braced Unicode escape and its written digit count.
- Decoding: Html Numeric Reference Token
Parse a restricted terminated HTML numeric reference and flag scalar validity.