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
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Related to Bug #11413: String#split with wchar string added
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Status changed from Open to Closed
Applied in changeset r51685.
re.c: fix wchar match at EOS
- re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching
till the end of string. [ruby-core:70592] [Bug #11488] - test/ruby/test_m17n.rb (test_include?, tet_index): add tests by
Tom Stuart.
Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED
This is introduced at r51470 for #11413 and it's backported into ruby_2_1
and ruby_2_2
.
Updated by usa (Usaku NAKAMURA) over 8 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: DONE, 2.2: REQUIRED
ruby_2_1 r51976 merged revision(s) 51685.
Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: DONE, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: DONE, 2.2: DONE
Backported into ruby_2_2
branch at r51986.
Actions
Like0
Like0Like0Like0Like0Like0