From: Fredrik Roubert Date: Mon, 13 Aug 2018 21:32:59 +0000 (+0200) Subject: ICU-13776 Use OpenType.DIRECT for loading the keyTypeData resources. X-Git-Tag: release-63-rc~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acfc55d0a575a02031d6f6827c7220164af1d59d;p=icu ICU-13776 Use OpenType.DIRECT for loading the keyTypeData resources. --- diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/locale/KeyTypeData.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/locale/KeyTypeData.java index a8dda07af10..68e09567a7a 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/locale/KeyTypeData.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/locale/KeyTypeData.java @@ -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")); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java index 3435d9894d6..bd20ce51006 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java @@ -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);