Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
MobiusHorizons
on June 2, 2023
|
parent
|
context
|
favorite
| on:
It’s not wrong that "🤦🏼♂️".length == 7 (2019)
The JavaScript language forces utf16 (whether or not v8 uses that representation under the hood). For instance if you want to substring the indexes you pass are for utf16 codepoints
lmm
on June 2, 2023
[–]
Sure, but arguing that that's a good reason for length to count utf16 is purely circular.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: