|
|
|
|
|
by mbell
3257 days ago
|
|
> have an additional .size method returning the number of bytes (I'm assuming that's what .length returns, if not it's even more confusing). It's actually not the number of bytes, it's the number of...'codepoint pieces' is what it could be called I guess? Javascript's language level string implementation is something like UCS-2 with the addition of surrogate pairs being allowed, but counted as separate 'characters' for things like length and index access. It's some twisted middle ground between UCS-2 and UTF-16. |
|
I understand a need in some contexts to distinguish between a character and its subsequent modifiers - but I do not see such a context here.
Design by committee?