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

Integer#chr(encoding: Encoding::UTF_8) raises a different RangeError exception message than on CRuby #7477

Closed
postmodern opened this issue Nov 23, 2022 · 0 comments · Fixed by #7694
Milestone

Comments

@postmodern
Copy link

postmodern commented Nov 23, 2022

Integer#chr(encoding: Encoding::UTF_8) raises a different RangeError exception message than on CRuby 3.1.0 when the byte value is invalid.

-1.chr(Encoding::UTF_8)

Environment Information

  • jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 17.0.5+8 on 17.0.5+8 +jit [x86_64-linux]
  • Linux dev 6.0.9-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 16 17:50:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • LANG=en_US.UTF-8

Expected Behavior

`chr': -1 out of char range (RangeError)

Actual Behavior

`chr': invalid codepoint ffffffff in UTF-8 (RangeError)
@headius headius added this to the JRuby 9.4.1.0 milestone Nov 23, 2022
@enebo enebo modified the milestones: JRuby 9.4.1.0, JRuby 9.4.2.0 Feb 2, 2023
headius added a commit to headius/jruby that referenced this issue Feb 28, 2023
headius added a commit to headius/jruby that referenced this issue Feb 28, 2023
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

Successfully merging a pull request may close this issue.

3 participants