Description
Validate point as a Unicode scalar and count its JSON string content units without outer quotes.
A JSON lexeme is its textual spelling, which differs from the decoded value. Escapes, quotes, raw control characters, and surrounding whitespace must be interpreted in context.
Validate point as a Unicode scalar and count its JSON string content units without outer quotes.
When to use this tool
Use JSON String Escape Length One Codepoint when you need a narrowly defined JSON string or separator diagnostic.
How to use the tool and how it works
- Enter point, asciiOnly. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read length. Use the output convention below.
Validate point as a Unicode scalar and count its JSON string content units without outer quotes. With asciiOnly, non-ASCII BMP scalars use six units and supplementary scalars twelve.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| point | Point | Required. Safe integer. |
| asciiOnly | Ascii Only | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| length | Serialized string-content length in UTF-16 code units, excluding outer quotation marks. | Required. Safe integer. |
{
"input": {
"point": 128512,
"asciiOnly": true
},
"output": {
"length": 12
}
} Limitations and assumptions
- The length is UTF-16 code units of an escaped representation, not UTF-8 bytes or user-visible characters.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Parse the entire document when validity matters; a local pattern match cannot establish complete JSON syntax.
References
Similar or alternative tools
- JSON String Escape Length Budget
Serialize value as a JSON string and return source UTF-16 length, complete serialized length, and their difference as overhead.
- JSON String Utf16 Codeunit Escape
Format codeUnit in 0-65535 as a lowercase four-digit JSON Unicode escape.