-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Milestone
Description
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.
Examples:
$ bin/jruby -e 'p Encoding.compatible?(Encoding.find("GB2312"), Encoding.find("EUC-KR")); p Encoding.compatible?(Encoding.find("EUC-KR"), Encoding.find("GB2312"))'
#<Encoding:EUC-KR>
#<Encoding:EUC-KR>
$ bin/jruby -e 'p Encoding.compatible?(Encoding.find("EUC-KR"), Encoding.find("GB2312")); p Encoding.compatible?(Encoding.find("GB2312"), Encoding.find("EUC-KR"))'
#<Encoding:GB2312>
#<Encoding:GB2312>
Metadata
Metadata
Assignees
Labels
No labels