2 ms·
I agree with everything you said, I think I'm just trying to reconcile that with the top of thread saying python was the most correct because it was returning '
by arcticbull 3y ago
I agree with everything you said, I think I'm just trying to reconcile that with the top of thread saying python was the most correct because it was returning '7 code points' and that 'UTF-whatever is an implementation detail'
But 7 is not the number of code points/USVs - that's the number of UTF-16 code units. The string is 5 USVs. If UTF-whatever is an implementation detail, wouldn't the correct answer to length be 5?
What am I missing haha.
- hgs3 3y agoPython does return 5. JavaScript returns 7. Python is returning the number of code points, JavaScript is returning the number of UTF-16 code units.
- arcticbull 3y agoThere's my mistake. Thank you. Flipped them in my head, it's ben a long day.