Internationalization: Normalization and canonical equivalence in string comparison
ecmascript at norbertlindenberg.com
Thu Jun 21 14:33:22 PDT 2012
I'm afraid it's not quite so simple. The Internationalization API spec defines localeCompare() as a wrapper around Intl.Collator.prototype.compare, so to make normalization mandatory for localeCompare, we'd have to make it mandatory for Collator as well. I'd like to get some input from implementors whether that makes sense, or whether they're planning to implement canonical equivalence in some other way.
On Jun 19, 2012, at 10:37 , Gillam, Richard wrote:
>> 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