Skip to content

Main content

JSON Property Key Surrogate Escape Check Tool

Compute json property key surrogate escape check from explicit bounded inputs.

Loading tool…

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

  1. Enter lexeme. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
lexemeSupplied token spelling; it is not automatically decoded text.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
validUnicodeValid UnicodeRequired. Boolean.
decodedDecodedRequired. Text; maximum UTF-16 length 8192.
json
{
  "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

  1. Calculation and input contract: json/json-property-key-surrogate-escape-check — tool.io

Similar or alternative tools