Bug #3376
closed
Added by dcab (Yury Korolev) over 14 years ago.
Updated over 13 years ago.
ruby -v:
ruby 1.9.2dev (2010-05-31 revision 28117) [x86_64-darwin10.3.0]
[ruby-core:30540]
Description
=begin
- String#upcase/String#downcase don't work with russian characters
ruby-1.9.2-preview3 > "привет".upcase
=> "привет"
ruby-1.9.2-preview3 > "ПРИВЕТ".downcase
=> "ПРИВЕТ"
- Regex doesn't work with POSIX bracket classes
ruby-1.9.2-preview3 > "привет" =~ /[:alpha:]/
=> nil
It's working with unicode groups
ruby-1.9.2-preview3 > "привет" =~ /\p{L}/
=> 0
- Negated unicode groups don't work
SyntaxError: (irb):13: invalid character property name {L}: /\P{L}/
from /Users/yury/.rvm/rubies/ruby-1.9.2-preview3/bin/irb:17:in `'
=end
=begin
- String#upcase/String#downcase don't work with russian characters
Ruby's String#upcase is for ASCII.
- Regex doesn't work with POSIX bracket classes
"привет" =~ /[:alpha:]/
"привет" =~ /[[:alpha:]]/ is correct.
- Negated unicode groups don't work
It seems a bug. I'll check it, thanks.
=end
- Assignee set to naruse (Yui NARUSE)
=begin
Hi,
Thank you for your report.
2010/6/1 Yury Korolev redmine@ruby-lang.org:
- String#upcase/String#downcase don't work with russian characters
This is the spec. Traditionally, they have handled only ASCII characters.
- Regex doesn't work with POSIX bracket classes
ruby-1.9.2-preview3 > "привет" =~ /[:alpha:]/
=> nil
This is also the spec. This spec was changed after 1.9.1.
See NEWS: http://svn.ruby-lang.org/repos/ruby/tags/v1_9_2_preview3/NEWS
The rationale is that many people expects \d and \s to match ASCII only.
- Negated unicode groups don't work
SyntaxError: (irb):13: invalid character property name {L}: /\P{L}/
from /Users/yury/.rvm/rubies/ruby-1.9.2-preview3/bin/irb:17:in `'
This looks like a bug. We'll investivage it. Thanks!
--
Yusuke Endoh mame@tsg.ne.jp
=end
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r28120.
Yury, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
- Related to Feature #10085: Add non-ASCII case conversion to String#upcase/downcase/swapcase/capitalize added
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0