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

Encoding.compatible? affected by call order #2312

nirvdrum opened this Issue Dec 12, 2014 · 0 comments


None yet
2 participants
Copy link

commented Dec 12, 2014

EncodingService has two lookup tables. One takes an Encoding's index and returns a RubyEncoding. This table is lazily created. A single Encoding may be used by multiple RubyEncodings. One such case is with "GB2312" and "EUC-KR". Whichever gets loaded first will occupy the spot in the table and the other will resolve to that RubyEncoding.


$ bin/jruby -e 'p Encoding.compatible?(Encoding.find("GB2312"), Encoding.find("EUC-KR")); p Encoding.compatible?(Encoding.find("EUC-KR"), Encoding.find("GB2312"))'
$ bin/jruby -e 'p Encoding.compatible?(Encoding.find("EUC-KR"), Encoding.find("GB2312")); p Encoding.compatible?(Encoding.find("GB2312"), Encoding.find("EUC-KR"))'

@enebo enebo added this to the milestone Apr 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.