-
Notifications
You must be signed in to change notification settings - Fork 185
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#casecmp? fails between ascii and utf-8 #2826
Comments
Thank you for the report. |
@notEthan Would you be interested to submit a PR for this, or you prefer the team fixes this? (either is fine) |
I had a look but getting a truffleruby development/build/test environment rolling looks to be more involved than I have time to put into this at the moment. |
No worry, the team will fix it then. |
…gs (#2826) PullRequest: truffleruby/3613
Nice, thanks for fixing. |
Comparing an ASCII-8BIT string with UTF-8, for both of which
#ascii_only?
is true, usingString#casecmp?
returns nil rather than a boolean e.g.It returns boolean on MRI, and the implementation to return boolean is present in truffleruby but not reached:
https://github.com/oracle/truffleruby/blob/vm-22.3.0/src/main/ruby/truffleruby/core/string.rb#L1204-L1213
The check
if ascii_only? && other.ascii_only?
is not reached afterPrimitive.encoding_compatible?(encoding, other.encoding)
returns nil.The text was updated successfully, but these errors were encountered: