@@ -85,30 +85,14 @@ static const char CURRENCY_MAP[] = "CurrencyMap";
85
85
// Tag for default meta-data, in CURRENCY_META
86
86
static const char DEFAULT_META[] = " DEFAULT" ;
87
87
88
- // Variant for legacy pre-euro mapping in CurrencyMap
89
- static const char VAR_PRE_EURO[] = " PREEURO" ;
90
-
91
- // Variant for legacy euro mapping in CurrencyMap
92
- static const char VAR_EURO[] = " EURO" ;
93
-
94
88
// Variant delimiter
95
89
static const char VAR_DELIM = ' _' ;
96
- static const char VAR_DELIM_STR[] = " _" ;
97
-
98
- // Variant for legacy euro mapping in CurrencyMap
99
- // static const char VAR_DELIM_EURO[] = "_EURO";
100
-
101
- #define VARIANT_IS_EMPTY 0
102
- #define VARIANT_IS_EURO 0x1
103
- #define VARIANT_IS_PREEURO 0x2
104
90
105
91
// Tag for localized display names (symbols) of currencies
106
92
static const char CURRENCIES[] = " Currencies" ;
107
93
static const char CURRENCIES_NARROW[] = " Currencies%narrow" ;
108
94
static const char CURRENCYPLURALS[] = " CurrencyPlurals" ;
109
95
110
- static const UChar EUR_STR[] = {0x0045 ,0x0055 ,0x0052 ,0 };
111
-
112
96
// ISO codes mapping table
113
97
static const UHashtable* gIsoCodes = NULL ;
114
98
static icu::UInitOnce gIsoCodesInitOnce = U_INITONCE_INITIALIZER;
@@ -360,30 +344,10 @@ _findMetaData(const UChar* currency, UErrorCode& ec) {
360
344
361
345
// -------------------------------------
362
346
363
- /* *
364
- * @see VARIANT_IS_EURO
365
- * @see VARIANT_IS_PREEURO
366
- */
367
- static uint32_t
347
+ static void
368
348
idForLocale (const char * locale, char * countryAndVariant, int capacity, UErrorCode* ec)
369
349
{
370
- uint32_t variantType = 0 ;
371
- // !!! this is internal only, assumes buffer is not null and capacity is sufficient
372
- // Extract the country name and variant name. We only
373
- // recognize two variant names, EURO and PREEURO.
374
- char variant[ULOC_FULLNAME_CAPACITY];
375
350
ulocimp_getRegionForSupplementalData (locale, FALSE , countryAndVariant, capacity, ec);
376
- uloc_getVariant (locale, variant, sizeof (variant), ec);
377
- if (variant[0 ] != 0 ) {
378
- variantType = (uint32_t )(0 == uprv_strcmp (variant, VAR_EURO))
379
- | ((uint32_t )(0 == uprv_strcmp (variant, VAR_PRE_EURO)) << 1 );
380
- if (variantType)
381
- {
382
- uprv_strcat (countryAndVariant, VAR_DELIM_STR);
383
- uprv_strcat (countryAndVariant, variant);
384
- }
385
- }
386
- return variantType;
387
351
}
388
352
389
353
// ------------------------------------------
@@ -568,7 +532,7 @@ ucurr_forLocale(const char* locale,
568
532
569
533
// get country or country_variant in `id'
570
534
char id[ULOC_FULLNAME_CAPACITY];
571
- uint32_t variantType = idForLocale (locale, id, UPRV_LENGTHOF (id), ec);
535
+ idForLocale (locale, id, UPRV_LENGTHOF (id), ec);
572
536
if (U_FAILURE (*ec)) {
573
537
return 0 ;
574
538
}
@@ -602,20 +566,6 @@ ucurr_forLocale(const char* locale,
602
566
UResourceBundle *countryArray = ures_getByKey (rb, id, cm, &localStatus);
603
567
UResourceBundle *currencyReq = ures_getByIndex (countryArray, 0 , NULL , &localStatus);
604
568
s = ures_getStringByKey (currencyReq, " id" , &resLen, &localStatus);
605
-
606
- // Get the second item when PREEURO is requested, and this is a known Euro country.
607
- // If the requested variant is PREEURO, and this isn't a Euro country,
608
- // assume that the country changed over to the Euro in the future.
609
- // This is probably an old version of ICU that hasn't been updated yet.
610
- // The latest currency is probably correct.
611
- if (U_SUCCESS (localStatus)) {
612
- if ((variantType & VARIANT_IS_PREEURO) && u_strcmp (s, EUR_STR) == 0 ) {
613
- currencyReq = ures_getByIndex (countryArray, 1 , currencyReq, &localStatus);
614
- s = ures_getStringByKey (currencyReq, " id" , &resLen, &localStatus);
615
- } else if ((variantType & VARIANT_IS_EURO)) {
616
- s = EUR_STR;
617
- }
618
- }
619
569
ures_close (currencyReq);
620
570
ures_close (countryArray);
621
571
}
@@ -2305,7 +2255,7 @@ ucurr_countCurrencies(const char* locale,
2305
2255
uloc_getKeywordValue (locale, " currency" , id, ULOC_FULLNAME_CAPACITY, &localStatus);
2306
2256
2307
2257
// get country or country_variant in `id'
2308
- /* uint32_t variantType = */ idForLocale (locale, id, sizeof (id), ec);
2258
+ idForLocale (locale, id, sizeof (id), ec);
2309
2259
2310
2260
if (U_FAILURE (*ec))
2311
2261
{
@@ -2421,7 +2371,7 @@ ucurr_forLocaleAndDate(const char* locale,
2421
2371
resLen = uloc_getKeywordValue (locale, " currency" , id, ULOC_FULLNAME_CAPACITY, &localStatus);
2422
2372
2423
2373
// get country or country_variant in `id'
2424
- /* uint32_t variantType = */ idForLocale (locale, id, sizeof (id), ec);
2374
+ idForLocale (locale, id, sizeof (id), ec);
2425
2375
if (U_FAILURE (*ec))
2426
2376
{
2427
2377
return 0 ;
0 commit comments