Skip to content

Main content

JSON: JSON Property Name Nfc Collision Pair Tool

Compare two potential JSON member names for NFC normalization collisions without normalizing or rewriting any object.

Loading tool…

Description

Normalize first and second to NFC, compare their original strings and normalized strings, and mark normalizationCollision only when distinct originals normalize identically.

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.

Normalize first and second to NFC, compare their original strings and normalized strings, and mark normalizationCollision only when distinct originals normalize identically.

When to use this tool

Use JSON: JSON Property Name Nfc Collision Pair when you need a decoded UTF-16 or normalization diagnostic.

How to use the tool and how it works

  1. Enter first, second. 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 result. Expand result to inspect the returned fields.

Normalize first and second to NFC, compare their original strings and normalized strings, and mark normalizationCollision only when distinct originals normalize identically.1

NFC applies canonical decomposition followed by canonical composition. Distinct input spellings can therefore normalize to one string; this diagnostic reports that collision rather than changing object keys.2

Input fieldMeaning and unitsAccepted input
firstFirst value or boundary under the stated formula.Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
secondSecond value or boundary under the stated formula.Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.exactEqualExact EqualCalculated result member: boolean.
result.nfcEqualNfc EqualCalculated result member: boolean.
result.normalizationCollisionNormalization CollisionCalculated result member: boolean.
json
{
  "input": {
    "first": "é",
    "second": "é"
  },
  "output": {
    "result": {
      "exactEqual": false,
      "nfcEqual": true,
      "normalizationCollision": true
    }
  }
}

Limitations and assumptions

  • No object is parsed and no case folding or compatibility normalization is applied; matching normalized keys are not automatically renamed.
  • 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 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-name-nfc-collision-pair — tool.io

  2. Unicode Standard Annex #15: Unicode Normalization Forms — Unicode Consortium

Similar or alternative tools