[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74225] [Ruby trunk Bug#11825] MatchData#names returns ASCII-8BIT
From:
nagachika00@...
Date:
2016-03-08 18:35:32 UTC
List:
ruby-core #74225
Issue #11825 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
Backported into `ruby_2_2` branch at r54036.
----------------------------------------
Bug #11825: MatchData#names returns ASCII-8BIT
https://bugs.ruby-lang.org/issues/11825#change-57360
* Author: Toru Iwase
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0preview2 (2015-12-11 trunk 53028) [x86_64-linux]
* Backport: 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
----------------------------------------
`MatchData#names` returns ASCII-8BIT.
But `MatchData#[]` doesn't accept ASCII-8BIT name if name has non-ASCII chars.
`MatchData#names` should return same encoding of regexp. (UTF-8 by default)
~~~
$ irb
ruby 2.3.0preview2 (2015-12-11 trunk 53028) [x86_64-linux]
irb(main):001:0> m = /(?<宝石>ルビー)/.match('ルビー')
=> #<MatchData "ルビー" 宝石:"ルビー">
irb(main):002:0> m.names
=> ["\xE5\xAE\x9D\xE7\x9F\xB3"]
irb(main):003:0> m[m.names[0]]
IndexError: undefined group name reference: "\xE5\xAE\x9D\xE7\x9F\xB3"
from (irb):3:in `[]'
from (irb):3
from /usr/local/anyenv/envs/rbenv/versions/2.3.0-preview2/bin/irb:11:in `<main>'
irb(main):004:0> m['宝石']
=> "ルビー"
irb(main):005:0> m.names[0].encoding
=> #<Encoding:ASCII-8BIT>
irb(main):006:0> m = /(?<gem>ルビー)/.match('ルビー')
=> #<MatchData "ルビー" gem:"ルビー">
irb(main):007:0> m.names
=> ["gem"]
irb(main):008:0> m.names[0].encoding
=> #<Encoding:ASCII-8BIT>
irb(main):009:0> m[m.names[0]]
=> "ルビー"
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>