3 ms·
But they're not a sequence of codepoints. They're a series of 16 bit values that can be set to anything, even invalid unicode. JavaScript has byte strings, no
by Dylan16807 11y ago
But they're not a sequence of codepoints. They're a series of 16 bit values that can be set to anything, even invalid unicode.
JavaScript has byte strings, not character strings.
- ygra 11y agoFor very wide bytes ;) I'd a sequence of code units instead of code points. Sadly that holds true for many string implementations in programming languages, often for history, compatibility, or efficiency reasons (e.g. C#could have done it right, being designed after the UCS-2/UTF-16 split, but they didn't for various reasons). So you get code unit sequences with a few functions tacked on top that add code point support.
- Dylan16807 11y agoHuh, I was wrong, there's no such thing as an invalid code unit. Even U+FFFE and U+FFFF are allowed.