-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
String#each_byte when the encoding is UTF-8 is incomplete #2138
Comments
ggrossetie
added a commit
to ggrossetie/opal
that referenced
this issue
Dec 12, 2020
ggrossetie
added a commit
to ggrossetie/opal
that referenced
this issue
Dec 12, 2020
s-leroux
pushed a commit
to s-leroux/opal
that referenced
this issue
May 24, 2021
s-leroux
pushed a commit
to s-leroux/opal
that referenced
this issue
May 25, 2021
s-leroux
pushed a commit
to s-leroux/opal
that referenced
this issue
May 26, 2021
s-leroux
pushed a commit
to s-leroux/opal
that referenced
this issue
May 26, 2021
ggrossetie
added a commit
to ggrossetie/opal
that referenced
this issue
Jul 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current implementation seems wrong/incomplete because we are using the UTF-16LE encoding by default (see #2117).
Anyway, this is what we get today:
Ruby 2.6.3 (MRI)
Opal v1.0.0 (f2d0d1adc)
And this is what I get if I force the encoding to UTF-8:
Ruby 2.6.3 (MRI)
Opal v1.0.0 (f2d0d1adc)
I found the following implementation: https://github.com/feross/buffer/blob/f52dffd9df0445b93c0c9065c2f8f0f46b2c729a/index.js#L1954-L2032 which seems to be working fine.
We could also use the following implementation in a Node.js environment:
The text was updated successfully, but these errors were encountered: