Actions
Feature #19317
openUnicode ICU Full case mapping
Description
As announced in Case Mapping, Ruby support for Unicode case mapping is not complete yet.
Unicode supports in Ruby is pretty awesome, it works by default nearly everywhere, things are implemented the right way and works as expected by the UTRs.
But some features are still missing.
To reach ICU Full Case Mapping support, a few points need to be enhanced.
context-sensitive case mapping¶
- cf. Table 3-17 (Context Specification for Casing) of the Unicode standard and ucd/SpecialCasing.txt.
"ΣΣ".downcase # returns σσ instead of σς
Output examples in ECMAScript:
Σ ➡️ σ
Σa ➡️ σa
aΣ ➡️ aς
aΣa ➡️ aσa
ΣA ➡️ σa
aΣ a ➡️ aς a
Σ1 ➡️ σ1
aΣ1 ➡️ aς1
ΣΣ ➡️ σς
language-sensitive case mapping¶
- Lithuanian rules
- Turkish and Azeri
"I".downcase # => "i"
"I".downcase(:turkic) # => "ı"
"I\u0307".upcase # => "İ"
"I\u0307".upcase(:lithuanian) # => "İ" instead of "I"
- using some standard locale / language codes
Also, it's true that for now there are only a few language-sensitive rules (for Lithuanian, Turkish and Azeri) but why:
- adding a
:turkic
symbol and not a:azeri
? - using full english arbitrary (why
turkic
and notturkish
?) language name rather than some ICU locale IDs?- Language code ISO-639 standard
- Script code Unicode ISO 15924 Registry
- country code ISO-3166 standard
So I would rather see something like that
"placeholder".upcase(locale: :tr_TR)
"placeholder".upcase(lang: :tr)
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0