From 696250f3791967716397c84243adc3dc0524a501 Mon Sep 17 00:00:00 2001
From: Doug Felt
First falls back through the primary ID, then through - * the fallbackID. The final fallback is the empty string, - * unless the primary id was the empty string, in which case + * the fallbackID. The final fallback is "root" + * unless the primary id was "root", in which case * there is no fallback. */ public boolean fallback() { @@ -301,8 +301,13 @@ public class ICULocaleService extends ICUService { return true; } if (fallbackID != null) { - currentID = fallbackID; - fallbackID = fallbackID.length() == 0 ? null : ""; + if (fallbackID.length() == 0) { + currentID = "root"; + fallbackID = null; + } else { + currentID = fallbackID; + fallbackID = ""; + } return true; } currentID = null; diff --git a/icu4j/src/com/ibm/icu/util/ULocale.java b/icu4j/src/com/ibm/icu/util/ULocale.java index 52ae7e04cd2..0612e75c251 100644 --- a/icu4j/src/com/ibm/icu/util/ULocale.java +++ b/icu4j/src/com/ibm/icu/util/ULocale.java @@ -229,7 +229,7 @@ public final class ULocale implements Serializable { * The root ULocale. * @stable ICU 2.8 */ - public static final ULocale ROOT = new ULocale(EMPTY_STRING, EMPTY_LOCALE); + public static final ULocale ROOT = new ULocale("root", EMPTY_LOCALE); private static final HashMap CACHE = new HashMap(20); static {