From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2023-01-07T02:03:22+00:00 Subject: [ruby-core:111707] [Ruby master Feature#19317] Unicode ICU Full case mapping Issue #19317 has been updated by nobu (Nobuyoshi Nakada). Description updated Status changed from Open to Assigned Assignee set to duerst (Martin D��rst) ---------------------------------------- Feature #19317: Unicode ICU Full case mapping https://bugs.ruby-lang.org/issues/19317#change-101106 * 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+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](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#full-language-specific-case-mapping), 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��" "I\u0307".upcase(:lithuanian) # => "I��" 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/