]> granicus.if.org Git - icu/commitdiff
ICU-8962 test & fix collation import from same bundle & from und=root
authorMarkus Scherer <markus.icu@gmail.com>
Tue, 8 Jul 2014 01:10:13 +0000 (01:10 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Tue, 8 Jul 2014 01:10:13 +0000 (01:10 +0000)
X-SVN-Rev: 36009

icu4c/source/data/coll/de.txt
icu4c/source/i18n/collationruleparser.cpp
icu4c/source/test/testdata/collationtest.txt

index 61c0f577512767dca5387946cee6e8b2e3b0540f..c230c8791f79c0bf00d57c99e1a6852acea7f42a 100644 (file)
@@ -22,120 +22,7 @@ de{
         }
         search{
             Sequence{
-                "[normalization on][suppressContractions [เ-ไ ເ-ໄ ꪵ ꪶ ꪹ ꪻ ꪼ]]"
-                "&'='<'≠'"
-                "&ا"
-                "<<<ﺎ<<<ﺍ"
-                "<<آ"
-                "<<<ﺂ<<<ﺁ"
-                "<<أ"
-                "<<<ﺄ<<<ﺃ"
-                "<<إ"
-                "<<<ﺈ<<<ﺇ"
-                "&و"
-                "<<<ۥ"
-                "<<<ﻮ<<<ﻭ"
-                "<<ؤ"
-                "<<<ﺆ<<<ﺅ"
-                "&ي"
-                "<<<ۦ"
-                "<<<ﻳ<<<ﻴ<<<ﻲ<<<ﻱ"
-                "<<ئ"
-                "<<<ﺋ<<<ﺌ<<<ﺊ<<<ﺉ"
-                "<<ى"
-                "<<<ﯨ<<<ﯩ"
-                "<<<ﻰ<<<ﻯ"
-                "&ه"
-                "<<<ﻫ<<<ﻬ<<<ﻪ<<<ﻩ"
-                "<<ة"
-                "<<<ﺔ<<<ﺓ"
-                "&[last primary ignorable]<<׳"
-                "<<״"
-                "<<ـ"
-                "<<ฺ"
-                "&ᄀ"
-                "=ᆨ"
-                "&ᄀᄀ"
-                "=ᄁ=ᆩ"
-                "&ᄀᄉ"
-                "=ᆪ"
-                "&ᄂ"
-                "=ᆫ"
-                "&ᄂᄌ"
-                "=ᆬ"
-                "&ᄂᄒ"
-                "=ᆭ"
-                "&ᄃ"
-                "=ᆮ"
-                "&ᄃᄃ"
-                "=ᄄ"
-                "&ᄅ"
-                "=ᆯ"
-                "&ᄅᄀ"
-                "=ᆰ"
-                "&ᄅᄆ"
-                "=ᆱ"
-                "&ᄅᄇ"
-                "=ᆲ"
-                "&ᄅᄉ"
-                "=ᆳ"
-                "&ᄅᄐ"
-                "=ᆴ"
-                "&ᄅᄑ"
-                "=ᆵ"
-                "&ᄅᄒ"
-                "=ᆶ"
-                "&ᄆ"
-                "=ᆷ"
-                "&ᄇ"
-                "=ᆸ"
-                "&ᄇᄇ"
-                "=ᄈ"
-                "&ᄇᄉ"
-                "=ᆹ"
-                "&ᄉ"
-                "=ᆺ"
-                "&ᄉᄉ"
-                "=ᄊ=ᆻ"
-                "&ᄋ"
-                "=ᆼ"
-                "&ᄌ"
-                "=ᆽ"
-                "&ᄌᄌ"
-                "=ᄍ"
-                "&ᄎ"
-                "=ᆾ"
-                "&ᄏ"
-                "=ᆿ"
-                "&ᄐ"
-                "=ᇀ"
-                "&ᄑ"
-                "=ᇁ"
-                "&ᄒ"
-                "=ᇂ"
-                "&ᅡᅵ"
-                "=ᅢ"
-                "&ᅣᅵ"
-                "=ᅤ"
-                "&ᅥᅵ"
-                "=ᅦ"
-                "&ᅧᅵ"
-                "=ᅨ"
-                "&ᅩᅡ"
-                "=ᅪ"
-                "&ᅩᅡᅵ"
-                "=ᅫ"
-                "&ᅩᅵ"
-                "=ᅬ"
-                "&ᅮᅴ"
-                "=ᅯ"
-                "&ᅮᅴᅵ"
-                "=ᅰ"
-                "&ᅮᅵ"
-                "=ᅱ"
-                "&AE<<ä<<<Ä"
-                "&OE<<ö<<<Ö"
-                "&UE<<ü<<<Ü"
+                "[import und-u-co-search][import de-u-co-phonebk]"
             }
             Version{"25"}
         }
index a47af8773e14e52ab7275b4b8d5d9ad3129acc5a..6eec3ee5689f506e573859abae1f9457691bbd4f 100644 (file)
@@ -622,6 +622,9 @@ CollationRuleParser::parseSetting(UErrorCode &errorCode) {
                 setParseError("expected language tag in [import langTag]", errorCode);
                 return;
             }
+            if(length == 3 && uprv_memcmp(baseID, "und", 3) == 0) {
+                uprv_strcpy(baseID, "root");
+            }
             // @collation=type, or length=0 if not specified
             char collationType[ULOC_KEYWORDS_CAPACITY];
             length = uloc_getKeywordValue(localeID, "collation",
index 74c46cbc419d1333ef273339e5220a703cfd0256..ec6a2c526b13ebb8bd0384c3a70fb051a8244dba 100644 (file)
 <1 ae
 <2 ä
 <3 Ä
+
+** test: import root search rules plus German phonebook rules, ICU ticket 8962
+@ locale de-u-co-search
+* compare
+<1 =
+<1 ≠
+<1 a
+<1 ae
+<2 ä
+
+# Once more, but with runtime builder.
+@ rules
+[import und-u-co-search][import de-u-co-phonebk]
+* compare
+<1 =
+<1 ≠
+<1 a
+<1 ae
+<2 ä
+
+# Once again, with import from "root" not "und" (as in a proper language tag).
+@ rules
+[import root-u-co-search][import de-u-co-phonebk]
+* compare
+<1 =
+<1 ≠
+<1 a
+<1 ae
+<2 ä