]> granicus.if.org Git - icu/commitdiff
ICU-13776 Use OpenType.DIRECT for loading the keyTypeData resources.
authorFredrik Roubert <roubert@google.com>
Mon, 13 Aug 2018 21:32:59 +0000 (23:32 +0200)
committerShane Carr <shane@unicode.org>
Thu, 27 Sep 2018 21:27:38 +0000 (14:27 -0700)
icu4j/main/classes/core/src/com/ibm/icu/impl/locale/KeyTypeData.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java

index a8dda07af106064d931e8635f547277ff3ff2304..68e09567a7a495bfe797e119b098427dd0fbcf35 100644 (file)
@@ -210,10 +210,11 @@ public class KeyTypeData {
     }
 
     private static void initFromResourceBundle() {
-        UResourceBundle keyTypeDataRes = UResourceBundle.getBundleInstance(
+        UResourceBundle keyTypeDataRes = ICUResourceBundle.getBundleInstance(
                 ICUData.ICU_BASE_NAME,
                 "keyTypeData",
-                ICUResourceBundle.ICU_DATA_CLASS_LOADER);
+                ICUResourceBundle.ICU_DATA_CLASS_LOADER,
+                ICUResourceBundle.OpenType.DIRECT);
 
         getKeyInfo(keyTypeDataRes.get("keyInfo"));
         getTypeInfo(keyTypeDataRes.get("typeInfo"));
index 3435d9894d66f678063183815f1465e1efe86b4f..bd20ce51006edfeea8fcede6fbadf4f500c3dc71 100644 (file)
@@ -4079,6 +4079,19 @@ public class ULocaleTest extends TestFmwk {
         }
     }
 
+    @Test
+    public void TestForLanguageTagBug13776() {
+        final Locale backupDefault = Locale.getDefault();
+        try {
+            Locale loc = Locale.forLanguageTag("ar-EG-u-nu-latn");
+            Locale.setDefault(loc);
+            ULocale uloc = ULocale.forLocale(loc);
+            assertEquals("getKeywordValue(\"numbers\")", "latn", uloc.getKeywordValue("numbers"));
+        } finally {
+            Locale.setDefault(backupDefault);
+        }
+    }
+
     @Test
     public void TestForLanguageTag() {
         final Integer NOERROR = Integer.valueOf(-1);