3 ms·
> The only modern language that gets it right is Swift: print("...".count) // => 1 And Erlang/Elixir! I guess they are not "cool" enough. But they cor
by rdtsc 3y ago
> The only modern language that gets it right is Swift:
print("...".count)
// => 1
And Erlang/Elixir! I guess they are not "cool" enough. But they correctly interpret that as one grapheme cluster.
% erl +pc unicode
> string:length("...").
1
(... here is the U+1F926 U+1F3FB U+200D U+2642 U+FE0F emoji)
- wodow 3y agoThe author does refer to Elixir further down: > UPD: Erlang/Elixir seem to be doing the right thing, too.
- rdtsc 3y agoUpdated a day after it was mentioned here :-) https://github.com/tonsky/tonsky.me/commit/5fbbb373025be375841cbb769dced514dec37312 https://github.com/tonsky/tonsky.me/commit/5fbbb373025be3758...