Skip to content
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

Utf8: count and countInString unexpected behavior #266

Open
ospencer opened this issue Aug 30, 2021 · 0 comments
Open

Utf8: count and countInString unexpected behavior #266

ospencer opened this issue Aug 30, 2021 · 0 comments

Comments

@ospencer
Copy link
Contributor

My understanding of these two functions is that they return the number of Unicode scalars in a string, such that List.length(decodeUcharInString(s)) == countInString(s) should always be true (but let me know if that isn't the intended behavior of countInString).

countInString("✨") returns a value of 3, but I expected it to return 1. That seems to be the case for most 3-byte utf8 characters, while 1-, 2-, and 4-byte characters return 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant