[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73972] [Ruby trunk Bug#11825] MatchData#names returns ASCII-8BIT
From:
usa@...
Date:
2016-02-25 07:47:54 UTC
List:
ruby-core #73972
Issue #11825 has been updated by Usaku NAKAMURA.
Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE, 2.2: REQUIRED
ruby_2_1 r53920 merged revision(s) 53167.
----------------------------------------
Bug #11825: MatchData#names returns ASCII-8BIT
https://bugs.ruby-lang.org/issues/11825#change-57125
* 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: REQUIRED
----------------------------------------
`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>