- if (U_SUCCESS(status)) {
- initialize(numberElements, numberElementsStrLen, numberElementsLength);
-
- // Obtain currency data from the currency API. This is strictly
- // for backward compatibility; we don't use DecimalFormatSymbols
- // for currency data anymore.
- UErrorCode internalStatus = U_ZERO_ERROR; // don't propagate failures out
- UChar curriso[4];
- UnicodeString tempStr;
- ucurr_forLocale(locStr, curriso, 4, &internalStatus);
-
- // Reuse numberElements[0] as a temporary buffer
- uprv_getStaticCurrencyName(curriso, locStr, tempStr, internalStatus);
- if (U_SUCCESS(internalStatus)) {
- fSymbols[kIntlCurrencySymbol] = curriso;
- fSymbols[kCurrencySymbol] = tempStr;
+ UResourceBundle *latnSymbols = ures_getByKeyWithFallback(numberElementsRes, gLatn, NULL, &status);
+ latnSymbols = ures_getByKeyWithFallback(latnSymbols, gSymbols, latnSymbols, &status);
+
+ UBool kMonetaryDecimalSet = FALSE;
+ UBool kMonetaryGroupingSet = FALSE;
+ for(int32_t i = 0; i<kFormatSymbolCount; i++) {
+ if ( gNumberElementKeys[i] != NULL ) {
+ UErrorCode localStatus = U_ZERO_ERROR;
+ if ( !isLatn ) {
+ sym = ures_getStringByKeyWithFallback(nonLatnSymbols,gNumberElementKeys[i],&len,&localStatus);
+ // If we can't find the symbol in the numbering system specific resources,
+ // use the "latn" numbering system as the fallback.
+ if ( U_FAILURE(localStatus) ) {
+ localStatus = U_ZERO_ERROR;
+ sym = ures_getStringByKeyWithFallback(latnSymbols,gNumberElementKeys[i],&len,&localStatus);
+ }
+ } else {
+ sym = ures_getStringByKeyWithFallback(latnSymbols,gNumberElementKeys[i],&len,&localStatus);
+ }
+
+ if ( U_SUCCESS(localStatus) ) {
+ setSymbol((ENumberFormatSymbol)i,sym);
+ if ( i == kMonetarySeparatorSymbol ) {
+ kMonetaryDecimalSet = TRUE;
+ } else if ( i == kMonetaryGroupingSeparatorSymbol ) {
+ kMonetaryGroupingSet = TRUE;
+ }