]> granicus.if.org Git - icu/commitdiff
ICU-8951 Minor updates including additional test cases.
authorYoshito Umaoka <y.umaoka@gmail.com>
Tue, 2 Sep 2014 23:41:52 +0000 (23:41 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Tue, 2 Sep 2014 23:41:52 +0000 (23:41 +0000)
X-SVN-Rev: 36316

icu4j/main/classes/core/src/com/ibm/icu/util/ULocale.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java

index e28726755ec88833a43537e910eee2bc0badff83..5f23061b6973b62798962ff887fd69190cbf7c25 100644 (file)
@@ -3292,12 +3292,12 @@ public final class ULocale implements Serializable, Comparable<ULocale> {
      * @provisional This API might change or be removed in a future release.
      */
     public static String toUnicodeLocaleKey(String keyword) {
-        String uniLocKey = KeyTypeData.toBcpKey(keyword);
-        if (uniLocKey == null && UnicodeLocaleExtension.isKey(keyword)) {
+        String bcpKey = KeyTypeData.toBcpKey(keyword);
+        if (bcpKey == null && UnicodeLocaleExtension.isKey(keyword)) {
             // unknown keyword, but syntax is fine..
-            uniLocKey = AsciiUtil.toLowerString(keyword);
+            bcpKey = AsciiUtil.toLowerString(keyword);
         }
-        return uniLocKey;
+        return bcpKey;
     }
 
     /**
index ecc2f9a9b72d7bcbcf44e09159d42899a95d9f17..a7eb6150332349f3c5ff337f934347b6eea2f9f1 100644 (file)
@@ -4508,6 +4508,10 @@ public class ULocaleTest extends TestFmwk {
                 {"ca",              "gregory-japanese-islamic", "gregory-japanese-islamic"},    // unknown type, well-formed type
                 {"zz",              "gregorian",        null},      // unknown key, ill-formed type
                 {"co",              "foo-",             null},      // unknown type, ill-formed type
+                {"variableTop",     "00A0",             "00a0"},    // valid codepoints type
+                {"variableTop",     "wxyz",             "wxyz"},      // invalid codepoints type - return as is for now
+                {"kr",              "space-punct",      "space-punct"}, // valid reordercode type
+                {"kr",              "digit-spacepunct", null},      // invalid reordercode type
         };
 
         for (String[] d : DATA) {
@@ -4542,6 +4546,10 @@ public class ULocaleTest extends TestFmwk {
                 {"zz",              "gregorian",        "gregorian"},   // unknown key, bcp ill-formed type
                 {"ca",              "gregorian-calendar",   "gregorian-calendar"},  // known key, bcp ill-formed type
                 {"co",              "e=mc2",            null},  // known key, ill-formed bcp/legacy type
+                {"variableTop",     "00A0",             "00a0"},        // valid codepoints type
+                {"variableTop",     "wxyz",             "wxyz"},        // invalid codepoints type - return as is for now
+                {"kr",              "space-punct",      "space-punct"}, // valid reordercode type
+                {"kr",              "digit-spacepunct", "digit-spacepunct"},    // invalid reordercode type, bad ok for legacy syntax
         };
 
         for (String[] d : DATA) {