
Issue #19317 has been updated by duerst (Martin Dürst). Just answering to one part: noraj (Alexandre ZANNI) wrote:
## language-sensitive case mapping
* [ ] 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 not `turkish`?) language name rather than some [ICU locale IDs](https://unicode-org.github.io/icu/userguide/locale/)?
'turkic' was chosen because it includes both Turkish and Azeri languages (see https://en.wikipedia.org/wiki/Turkic_languages).
- Language code ISO-639 standard - Script code Unicode ISO 15924 Registry
Script isn't relevant here, as the characters themselves are directly available.
- country code ISO-3166 standard
So I would rather see something like that
```ruby "placeholder".upcase(locale: :tr_TR) "placeholder".upcase(lang: :tr) ```
Something like this was discussed. My recollection was that it was rejected because it was overkill for the case at hand, and there was no other functionality in core Ruby that needed it. ---------------------------------------- Feature #19317: Unicode ICU Full case mapping https://bugs.ruby-lang.org/issues/19317#change-101121 * Author: noraj (Alexandre ZANNI) * Status: Assigned * Priority: Normal * Assignee: duerst (Martin Dürst) ---------------------------------------- As announced in [Case Mapping](https://docs.ruby-lang.org/en/master/case_mapping_rdoc.html#label-Default+Ca...), 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](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#ful...), a few points need to be enhanced. ### context-sensitive case mapping * [ ] cf. [Table 3-17 (Context Specification for Casing) of the Unicode standard](https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf) and [ucd/SpecialCasing.txt](https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt). ```ruby "ΣΣ".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 * [x] Turkish and Azeri ```ruby "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 not `turkish`?) language name rather than some [ICU locale IDs](https://unicode-org.github.io/icu/userguide/locale/)? - Language code ISO-639 standard - Script code Unicode ISO 15924 Registry - country code ISO-3166 standard So I would rather see something like that ```ruby "placeholder".upcase(locale: :tr_TR) "placeholder".upcase(lang: :tr) ``` -- https://bugs.ruby-lang.org/