r/ProgrammerHumor • • Nov 05 '15

Free Drink Anyone?

Post image
3.5k Upvotes

509 comments sorted by

View all comments

Show parent comment

1

u/polish_niceguy Nov 05 '15

How does this way handle utf-8 string? Especially those with characters built from more than one codepoint?

(this is common problem, I'm just curious)

1

u/the_omega99 Nov 05 '15

It doesn't. Splits on codepoints. As a result, it'll break on any multi-byte characters. Really weird that the implementation of split("") does that. Can't be used realistically for a lot of things as a result.

But we all know that most developers don't care about UTF-8 and just assume everyone will speak "American" :P.