[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...

Issue #11420 has been reported by Koichi Sasada.

11 messages 2015/08/06

[ruby-core:70592] [Ruby trunk - Bug #11488] [Open] String#index and #include? broken for wide encodings

From: tom@...
Date: 2015-08-25 16:08:54 UTC
List: ruby-core #70592
Issue #11488 has been reported by Tom Stuart.

----------------------------------------
Bug #11488: String#index and #include? broken for wide encodings
https://bugs.ruby-lang.org/issues/11488

* Author: Tom Stuart
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
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--------------------------------
string-index-include-wide-bug.patch (1.18 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next