Actions
Bug #11488
closedString#index and #include? broken for wide encodings
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
Backport:
Description
In Ruby 2.2.2, String#index
and #include?
work as expected for all encodings:
>> Encoding.list.reject(&:dummy?).
reject { |e| 'abcdef'.encode(e).include?('def'.encode(e)) }.
map(&:name)
=> []
But in Ruby 2.2.3 and trunk, they have become broken for wide encodings:
>> Encoding.list.reject(&:dummy?).
reject { |e| 'abcdef'.encode(e).include?('def'.encode(e)) }.
map(&:name)
=> ["UTF-16BE", "UTF-16LE", "UTF-32BE", "UTF-32LE"]
This broke as a result of revision 51470 (trunk) / 51590 (2.2.3). I attach a test.
Files
Actions
Like0
Like0Like0Like0Like0Like0