Description
Parse one braced Unicode escape and its written digit count.
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.
Parse one braced Unicode escape and its written digit count.
When to use this tool
Use Unicode Escape Braced Digit Budget 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 point, digitCount. Use the output convention below.
Parse one braced Unicode escape and its written digit count. Require literal backslash-u braces containing one to six hexadecimal digits and a valid Unicode scalar; return point and digitCount.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| point | Point | Required. Safe integer. |
| digitCount | Digit Count | Required. Safe integer. |
{
"input": {
"token": "\\u{1F600}"
},
"output": {
"point": 128512,
"digitCount": 5
}
} Limitations and assumptions
- Surrogates and out-of-range values are rejected; the output is not evaluated as source code.
- 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
Similar or alternative tools
- Decoding: ECMAScript Unicode Code Point Escape
Decode one braced scalar escape to a code point and character.
- Utf16 Lone Surrogate Token Label
Classify a numeric UTF-16 code unit.