Project

General

Profile

Bug #12204

Invalid range of capital letters at Greek alphabet

Added by tzabaman (George Vrettos) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[ruby-core:74478]

Description

Greek alphabet's first and last letter is:
* α - ω (lower case)
* Α - Ω (upper case)

So if we write on a ruby console the following script, we get:

('α'..'ω').to_a

=> ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "ς", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"] 

which is correct, we get all 24 lower case characters of the greek alphabet, and a "special one", the letter "ς" which HAS NO EQUIVALENT uppercase letter. TOTAL: 25 characters

Now if we try to run the above script with upper case characters...

('Α'..'Ω').to_a

=> ["Α", "Β", "Γ", "Δ", "Ε", "Ζ", "Η", "Θ", "Ι", "Κ", "Λ", "Μ", "Ν", "Ξ", "Ο", "Π", "Ρ"]

we only get 17 characters. The rest 7 upper case characters are missing! Those are (["Σ", "Τ", "Υ", "Φ", "Χ", "Ψ", "Ω"])

Now if we try to "construct" the greek alphabet by using the UTF-8 equivalent number of its chatacter, we get the following:

(913..937).map { |char| char.chr('UTF-8') }

=> ["Α", "Β", "Γ", "Δ", "Ε", "Ζ", "Η", "Θ", "Ι", "Κ", "Λ", "Μ", "Ν", "Ξ", "Ο", "Π", "Ρ", "\u03A2", "Σ", "Τ", "Υ", "Φ", "Χ", "Ψ", "Ω"]

Note the invalid character "\u03A2" between letters "Ρ" and "Σ".

I believe that the problem is the letter "ς" (greek sigma) which has no upper case equivalent. Ruby throws an exception at this point and never returns the rest of the characters.

[[[http://www.fileformat.info/info/unicode/char/03a2/index.htm]]]

Associated revisions

Revision 54210
Added by nobu (Nobuyoshi Nakada) over 1 year ago

string.c: skip invalid char gap

  • string.c (enc_succ_alnum_char): try to skip an invalid character gap between GREEK CAPITAL RHO and SIGMA. [Bug #12204]

Revision 54210
Added by nobu (Nobuyoshi Nakada) over 1 year ago

string.c: skip invalid char gap

  • string.c (enc_succ_alnum_char): try to skip an invalid character gap between GREEK CAPITAL RHO and SIGMA. [Bug #12204]

Revision 54284
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 54210: [Backport #12204]

* string.c (enc_succ_alnum_char): try to skip an invalid character
  gap between GREEK CAPITAL RHO and SIGMA.
   [Bug #12204]

Revision 54336
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 54210: [Backport #12204]

* string.c (enc_succ_alnum_char): try to skip an invalid character
  gap between GREEK CAPITAL RHO and SIGMA.
   [Bug #12204]

Revision 54384
Added by naruse (Yui NARUSE) over 1 year ago

merge revision(s) 54210: [Backport #12204]

* string.c (enc_succ_alnum_char): try to skip an invalid character
  gap between GREEK CAPITAL RHO and SIGMA.
   [Bug #12204]

History

#1 [ruby-core:74479] Updated by tzabaman (George Vrettos) over 1 year ago

  • ruby -v changed from 2.3.0 to ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

#2 Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset r54210.


string.c: skip invalid char gap

  • string.c (enc_succ_alnum_char): try to skip an invalid character gap between GREEK CAPITAL RHO and SIGMA. [Bug #12204]

#3 [ruby-core:74523] Updated by usa (Usaku NAKAMURA) over 1 year ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED

#4 [ruby-core:74568] Updated by usa (Usaku NAKAMURA) over 1 year ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED

ruby_2_1 r54284 merged revision(s) 54210.

#5 [ruby-core:74637] Updated by nagachika (Tomoyuki Chikanaga) over 1 year ago

  • Backport changed from 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: DONE, 2.2: DONE, 2.3: REQUIRED

Backported into ruby_2_2 branch at r54336.

#6 [ruby-core:74676] Updated by naruse (Yui NARUSE) over 1 year ago

  • Backport changed from 2.1: DONE, 2.2: DONE, 2.3: REQUIRED to 2.1: DONE, 2.2: DONE, 2.3: DONE

ruby_2_3 r54384 merged revision(s) 54210.

Also available in: Atom PDF