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

Add a spec for String#to_sym with same content but distinct encoding #919

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

casperisfine
Copy link
Contributor

I found a bug in JRuby while working on msgpack:

https://github.com/msgpack/msgpack-ruby/blob/37949d20920225972b51f4cc69c8fbec775cc9fd/spec/factory_spec.rb#L338-L341

cc @eregon

Also cc @headius (in case this isn't a known or expected difference)

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ahorek
Copy link
Contributor

ahorek commented Feb 10, 2022

the symbol is interned on the first touch to the symbols table as Encoding::ISO_8859_1. On the second touch, the symbol is already known because the binary representation is exactly the same, but the original encoding has been changed so it doesn't match anymore. This sharing is quite unexpected and it should be fixed.

very nice reproduction btw

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

Successfully merging this pull request may close these issues.

4 participants