Unicode / normalization decisions

Choose safe Unicode normalization and preserve identifiers

Separate display-only cleanup from a transformation that changes an identifier. Compare before and after, and change only when the input owner has allowed it.

Separate the use case first

ExampleBeforeFormAfterDecision
Display full-widthABC123NFKCABC123Change if allowed
Compatibility①ÅNFKCReview
Combining markNFCéDisplay candidate
IdentifierA-123NFKCA-123Keep original

A normalization form does not decide safety by itself. Confirm the use and the owner of the input contract.

Verify with fixtures

Read fullwidth.txt, compatibility.txt, combining.txt and identifier.txt, then compare the before/after values and decisions in expected.csv. Do not send real data or overwrite the original identifier.

const display = text.normalize("NFC");
const compatibility = text.normalize("NFKC");
// Keep the original when it is an identifier.

Review in this order

  1. Separate display-only text from IDs, keys, codes, filenames and lookup values.
  2. Check whether the input specification names NFC/NFKC and allows the change.
  3. Keep the original and compare before/after with synthetic fixtures.
  4. If the contract is unknown, mark it for review; do not claim the change is safe.

This guide is static browser-local material. Text and input are not sent to an external server.

Keep identifiers original

Normalization can improve display or search, but it does not guarantee identity. Keep original and display values separate, and use the original as the key unless the owner explicitly permits the transformation.