[ruby/irb] Fix Locale's encoding lookup for Japanese encodings (https://github.com/ruby/irb/pull/568)
In https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d, encoding_aliases.rb was introduced to return the correct encoding object for ujis and euc encodings.
encoding_aliases.rb
ujis
euc
However, the return value of @@legacy_encoding_alias_map[@encoding_name] is always overridden by a second look up with Encoding.find(@encoding_name). So the logic didn't work as expected.
@@legacy_encoding_alias_map[@encoding_name]
Encoding.find(@encoding_name)
This commit fixes the problem.
[ruby/irb] Fix Locale's encoding lookup for Japanese encodings
(https://github.com/ruby/irb/pull/568)
In https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d,
encoding_aliases.rb
was introduced to return the correct encoding object forujis
andeuc
encodings.However, the return value of
@@legacy_encoding_alias_map[@encoding_name]
is always overridden by a second look up with
Encoding.find(@encoding_name)
.So the logic didn't work as expected.
This commit fixes the problem.