Description
Parse lexeme as a string and scan UTF-16 surrogate pairing.
JSON strings use escape syntax, while decoded JavaScript strings are sequences of UTF-16 units. A supplementary Unicode scalar occupies a surrogate pair, and a lone surrogate is not a complete scalar.
Parse lexeme as a string and scan UTF-16 surrogate pairing.
When to use this tool
Use JSON Property Key Surrogate Escape Check when you need a decoded UTF-16 or normalization diagnostic.
How to use the tool and how it works
- Enter lexeme. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read validUnicode, decoded. Inspect validUnicode before interpreting the associated values.
Parse lexeme as a string and scan UTF-16 surrogate pairing. Return decoded text and validUnicode false for any lone high or low surrogate.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lexeme | Supplied token spelling; it is not automatically decoded text. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| validUnicode | Valid Unicode | Required. Boolean. |
| decoded | Decoded | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"lexeme": "\"\\ud800\""
},
"output": {
"validUnicode": false,
"decoded": "\ud800"
}
} Limitations and assumptions
- Successful JSON parsing does not guarantee paired Unicode surrogates; the tool reports rather than repairs decoded text.
- 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 Unicode-aware text processing and a full JSON parser when decoding, comparing, or repairing complete documents.
References
Similar or alternative tools
- JSON Unpaired Surrogate Lexeme Flag
Parse lexeme as a JSON string and scan its UTF-16 units.
- JSON String Utf16 Pair Assembly
Combine the pair as 65536 + (high - 55296) × 1024 + low - 56320 and return scalar and text.