-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
unicode/utf16: add RuneLen #44940
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Excellent! I will work on a patch |
@bouk any update? I'm interested in this proposal landing soon, if you are focused on other projects I can take over this implementation. |
RuneLen returns the number of 16-bit words required to encode a rune. Fixes golang#44940
I've created a PR: #51894 |
Change https://go.dev/cl/395114 mentions this issue: |
Change https://go.dev/cl/569755 mentions this issue: |
Sometimes it's useful to determine how many 16-bit words it'll take to encode a unicode rune with UTF16. We already have
utf8.RuneLen
, and one for utf16 could be useful.It would look something like this (those are private constants inside of utf16):
The text was updated successfully, but these errors were encountered: