Project

General

Profile

Actions

Bug #3376

closed

russian support

Added by dcab (Yury Korolev) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2010-05-31 revision 28117) [x86_64-darwin10.3.0]
Backport:
[ruby-core:30540]

Description

=begin

  1. String#upcase/String#downcase don't work with russian characters

ruby-1.9.2-preview3 > "привет".upcase
=> "привет"
ruby-1.9.2-preview3 > "ПРИВЕТ".downcase
=> "ПРИВЕТ"

  1. 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

  1. 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


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #10085: Add non-ASCII case conversion to String#upcase/downcase/swapcase/capitalizeClosedduerst (Martin Dürst)Actions
Actions #1

Updated by naruse (Yui NARUSE) over 14 years ago

=begin

  1. String#upcase/String#downcase don't work with russian characters

Ruby's String#upcase is for ASCII.

  1. Regex doesn't work with POSIX bracket classes
    "привет" =~ /[:alpha:]/

"привет" =~ /[[:alpha:]]/ is correct.

  1. Negated unicode groups don't work

It seems a bug. I'll check it, thanks.
=end

Actions #2

Updated by naruse (Yui NARUSE) over 14 years ago

  • Assignee set to naruse (Yui NARUSE)

=begin

=end

Actions #3

Updated by mame (Yusuke Endoh) over 14 years ago

=begin
Hi,

Thank you for your report.

2010/6/1 Yury Korolev :

  1. String#upcase/String#downcase don't work with russian characters

This is the spec. Traditionally, they have handled only ASCII characters.

  1. 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.

  1. 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

=end

Actions #4

Updated by naruse (Yui NARUSE) over 14 years ago

  • 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

Updated by duerst (Martin Dürst) over 10 years ago

  • Related to Feature #10085: Add non-ASCII case conversion to String#upcase/downcase/swapcase/capitalize added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0