Internationalization: Normalization and canonical equivalence in string comparison

Gillam, Richard gillam at
Tue Jun 19 10:37:22 PDT 2012


> The ECMAScript Internationalization API Specification currently has normalization as an optional feature in collation. However, it requires that the compare function "return 0 when comparing Strings that are considered canonically equivalent by the Unicode standard". Canonical equivalence, I thought, is usually implemented through normalization. Does it make sense to keep normalization as a separate and optional feature then? Is anybody planning to implement canonical equivalence through other mechanisms, such that the lack of normalization would be visible in the comparison of non-equivalent strings?

For what little it may be worth, I think it would make sense to just make normalization mandatory in localeCompare().  Of course, I don't know if that causes trouble for anybody (I'm pretty sure it doesn't for me).

--Rich Gillam

More information about the es-discuss mailing list