On Wed, Apr 1, 2015 at 10:30 PM, monolithed <monolit...@gmail.com> wrote: >> What you’re seeing there is not normalization, but rather the string >> iterator that automatically accounts for surrogate pairs (treating them as a >> single unit). > > ```js > var foo = '𝐀'; > var bar = 'Й'; > foo.length; // 2 > Array.from(foo).length // 1 > > bar.length; // 2 > Array.from(foo).length // 2 > ``` > > I think this is strange. > How to safely work with strings?
It depends on your use case. FWIW, I’ve outlined some examples here: https://mathiasbynens.be/notes/javascript-unicode _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss