Unicode Normalizer

Compare and normalize text using NFC, NFD, NFKC, and NFKD.

How to interpret Unicode and segmentation

Unicode Normalizer works with a layer of text that is not always visible on screen. A user-perceived character may contain several code points, emoji may use ZWJ sequences, and word rules vary by language.

  • Distinguish UTF-16 units, code points, and grapheme clusters before defining field limits or positions.
  • Use normalization when comparing equivalent text represented by different sequences.
  • Treat results as a default analysis: languages such as Thai, Chinese, and Japanese may need tailored rules.
Practical tip: Do not cut text inside a grapheme cluster. Test emojis, combining marks, and different scripts.

Como usar este módulo

Normalização Unicode permite comparar sequências canonicamente equivalentes. NFC costuma preservar uma forma composta, enquanto NFD separa marcas; NFKC e NFKD também aplicam compatibilidade.

Dica prática: Documente a forma escolhida para que outros sistemas reproduzam a mesma comparação.