3 ms·
Great! A few notes: - It'd be nice to have additional transformations: NFKC, NFKD, and maybe some others like CLDR transliteration, confusable mapping, ... -
by nneonneo 3y ago
Great! A few notes:
- It'd be nice to have additional transformations: NFKC, NFKD, and maybe some others like CLDR transliteration, confusable mapping, ...
- Characters outside the BMP get broken down as surrogate pairs, which is not what you want. Non-BMP characters they should be treated as a single codepoint; surrogate pairs are an implementation artifact of JavaScript's internal UTF-16 representation.
- tialaramex 3y agoWell, of UTF-16 itself, not specific to Javascript. What they're exposing are the 16-bit Code Units of UTF-16, which happen to be (reserved) Unicode Code Points, but are not Unicode Scalar Values. I guess I don't know what this software is for? But the references to the normalisation forms makes me assume it's about Unicode and so it ought to work in the actual Code Points, not these surrogates.