Unicode normalization (NFC/NFD)
Putting equivalent Unicode spellings into one form so a precomposed accent and the same combining accent compare as the same text.
What it is
Unicode normalization puts canonically equivalent text into the same code-point form. The visible 'é' can be one precomposed character or an 'e' followed by a combining acute accent; they render alike but compare unequal as raw strings. NFC prefers composed forms, while NFD decomposes them. JavaScript exposes both through String.prototype.normalize().
Use NFC at controlled boundaries for human-authored text that must compare, deduplicate, or become a stable lookup key. Normalize before enforcing a unique constraint or computing that key, and test pasted text and filenames from different operating systems. This is the classic macOS HFS+ trap: it stored filenames decomposed, so a file named 'resume' with an acute accent created on a Mac did not byte-match the same name typed on Windows or Linux, and sync tools produced two entries. For locale-aware search, normalization is only the first step; Intl.Collator handles case and accent sensitivity.
Gotcha: normalization is not transliteration, spell correction, or a safe license to rewrite every string. It does not make 'é' equal to 'e', and compatibility forms NFKC and NFKD can change distinctions such as styled characters. Do not silently normalize passwords, cryptographic material, opaque IDs, or signed bytes unless that protocol explicitly defines the same normalization policy.
Ask AI for it
Add Unicode NFC normalization for human-authored names, labels, and searchable text. Call String.prototype.normalize('NFC') at the input boundary before equality checks, deduplication, lookup-key generation, and database inserts, and normalize existing comparison operands the same way during migration. Exclude passwords, tokens, opaque external IDs, file bytes, and cryptographic signatures. Use Intl.Collator for locale-aware case or accent-insensitive search rather than stripping diacritics. Add tests for U+00E9 versus U+0065 U+0301, Hangul composed versus decomposed forms, and already-normalized ASCII.