|
|
|
|
|
by demurgos
314 days ago
|
|
> The ECMAScript/JavaScript language itself, however, exposes characters according to UCS-2, not UTF-16. The native JS semantics are UCS-2. Saying that it's UTF-16 is misleading and confuses charset, encoding and browser APIs. Ladybird is probably implementing support properly but it's annoying that they keep spreading the confusion in their article. |
|
Generally though JS's strings are just a list of 16-bit values, being intrinsically neither UCS-2 nor UTF-16. But, practically speaking, UTF-16 is the description that matters for everything other than writing `str.length`/`str[i]`.