ICU-8284 fix for root locale with modifier falling back to platform default

X-SVN-Rev: 29366
This commit is contained in:
Stuart Gill 2011-01-27 21:09:03 +00:00
parent ff9448fe98
commit ff2821ca77
2 changed files with 3 additions and 1 deletions

View file

@ -823,7 +823,7 @@ public class ICUResourceBundle extends UResourceBundle {
ClassLoader root, boolean disableFallback){
ULocale defaultLocale = ULocale.getDefault();
String localeName = localeID;
if(localeName.indexOf('@')>0){
if(localeName.indexOf('@')>=0){
localeName = ULocale.getBaseName(localeID);
}
String fullName = getFullName(baseName, localeName);

View file

@ -492,6 +492,8 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk {
{"ru_RU", "5", "RUB", "5,00\u00A0\u0440\u0443\u0431.", "5,00\u00A0RUB", "5,00 \u0420\u043E\u0441\u0441\u0438\u0439\u0441\u043A\u0438\u0445 \u0440\u0443\u0431\u043B\u0435\u0439"},
// test locale without currency information
{"root", "-1.23", "USD", "-US$\u00a01.23", "-USD\u00a01.23", "-1.23 USD"},
{"root@numbers=latn", "-1.23", "USD", "-US$\u00a01.23", "-USD\u00a01.23", "-1.23 USD"}, // ensure that the root locale is still used with modifiers
{"root@numbers=arab", "-1.23", "USD", "-US$\u00a0\u0661.\u0662\u0663", "-USD\u00a0\u0661.\u0662\u0663", "-\u0661.\u0662\u0663 USD"}, // ensure that the root locale is still used with modifiers
// test choice format
{"es_AR", "1", "INR", "Rs\u00A01,00", "INR\u00A01,00", "1,00 rupia india"},
{"ar_EG", "1", "USD", "US$\u00A0\u0661\u066B\u0660\u0660", "USD\u00a0\u0661\u066b\u0660\u0660", "\u0661\u066b\u0660\u0660 \u062f\u0648\u0644\u0627\u0631 \u0623\u0645\u0631\u064a\u0643\u064a"},