Index: source/common/locid.cpp |
diff --git a/source/common/locid.cpp b/source/common/locid.cpp |
index f073aadedc89a11ad9c98eaedbfda39c5462d978..02da9888bd300cd18136beeb646ca331a5bc988c 100644 |
--- a/source/common/locid.cpp |
+++ b/source/common/locid.cpp |
@@ -509,6 +509,13 @@ Locale& Locale::init(const char* localeID, UBool canonicalize) |
/* preset all fields to empty */ |
language[0] = script[0] = country[0] = 0; |
+ // Need to reset baseName. Otherwise, when a Locale object created with |
+ // the default constructor is changed with setFromPOSIXID() later |
+ // (e.g. locales obtained with getAvailableLocales()), |
+ // baseName will be still that of the default locale instead of one |
+ // corresponding to localeID. |
+ baseName = NULL; |
+ |
// "canonicalize" the locale ID to ICU/Java format |
err = U_ZERO_ERROR; |
length = canonicalize ? |