Description
I understand that this is a kind of massive breaking change, and I'm looking for a migration path, but haven't found one yet.
As you can see, current String.length
is confusing and harmful especially for non-english speakers.
I believe there are almost no correct usage of current String.length
, because we can't manipulate String
with it correctly.
The root cause of this is that String
is sequence of int
s representing code units but not code points even at surface of the API.
So, this proposal include introducing Rune
(not Runes
) as int
representing a code point and changing String
as a sequence of Rune
s at least from view point of API.
This proposal might also include deprecating current operator []
of String
and introducing runeAt()
to String
.
Don't misunderstand me, I don't assert that the internal representation of String
should be sequence of code points, by this proposal.