On 4/1/15 6:56 PM, Andrea Giammarchi wrote:
Why is that

Because those are different things. The first is a single Unicode character that happens to be represented by 2 UTF-16 code units. The second is a pair of Unicode characters that are each represented by one UTF-16 code unit, but also happen to form a single grapheme cluster (because one of them is a combining character). To complicate things further, there is also a single Unicode character that represents that same grapheme cluster....

String length shows the number of UTF-16 code units.

Array.from works on Unicode characters. That explains the foo.length and Array.from(foo).length results.

and how to solve?

Can you clearly explain what problem you are trying to solve?

-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to