New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std/text/unicode graphemes does not return a list of grapheme clusters to iterate #458
Comments
See Line 56 in f48555f
Note that strings already are utf16, and characters are utf16 code points. So doing Here are some adjustments to the current that I think gives you what you want:
All of the different normalization schemes give the same result in this case. I added the zero width joiner to the From the api description copied below it is not clear if self-contained symbol would mean to keep the heart / fire and variation selector separate or not: It seems to me that since the variation selectors and zero width joiner do not have any character representation that the above changes should be incorporated. Either way, at minimum I think there should be changes made to make
|
I thought
graphemes("hi❤️🔥")
would return the list:
["h", "i", "❤️🔥"]
, a list of grapheme clusters that i could iterate with:which would print out single grapheme clusters like:
also if i print
l.length
now it returns6
, i wish there was a function which would return the number of grapheme clusters like 3 in this case.I'm new to
koka
and these libraries so sorry if i've mistaken the usage.This Dart Characters package might be inspiration
The text was updated successfully, but these errors were encountered: