From: Yoshito Umaoka Date: Mon, 18 Jul 2011 21:43:18 +0000 (+0000) Subject: ICU-8488 Reviewed call sites of case conversion code in icu library code and updated... X-Git-Tag: milestone-59-0-1~4635 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2103b01f0bac1b05bf61f9028605e23751104f2;p=icu ICU-8488 Reviewed call sites of case conversion code in icu library code and updated some of them case sensitive/insensitive. X-SVN-Rev: 30382 --- diff --git a/icu4c/source/i18n/plurrule.cpp b/icu4c/source/i18n/plurrule.cpp index edb7d807271..d9228b51ab7 100644 --- a/icu4c/source/i18n/plurrule.cpp +++ b/icu4c/source/i18n/plurrule.cpp @@ -351,7 +351,7 @@ PluralRules::parseDescription(UnicodeString& data, RuleChain& rules, UErrorCode if (U_FAILURE(status)) { return; } - UnicodeString ruleData = data.toLower(); + UnicodeString ruleData = data.toLower(""); while (ruleIndex< ruleData.length()) { mParser->getNextToken(ruleData, &ruleIndex, token, type, status); if (U_FAILURE(status)) { diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 9df9659f674..c1b9f1e3697 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -1373,7 +1373,7 @@ TimeZone::parseCustomID(const UnicodeString& id, int32_t& sign, NumberFormat* numberFormat = 0; UnicodeString idUppercase = id; - idUppercase.toUpper(); + idUppercase.toUpper(""); if (id.length() > GMT_ID_LENGTH && idUppercase.startsWith(GMT_ID, GMT_ID_LENGTH)) diff --git a/icu4c/source/i18n/ucurr.cpp b/icu4c/source/i18n/ucurr.cpp index ffad4ff364e..152af95fbd9 100644 --- a/icu4c/source/i18n/ucurr.cpp +++ b/icu4c/source/i18n/ucurr.cpp @@ -801,16 +801,15 @@ getCurrencyNameCount(const char* loc, int32_t* total_currency_name_count, int32_ } } -// TODO: locale dependent static UChar* -toUpperCase(const UChar* source, int32_t len) { +toUpperCase(const UChar* source, int32_t len, const char* locale) { UChar* dest = NULL; UErrorCode ec = U_ZERO_ERROR; - int32_t destLen = u_strToUpper(dest, 0, source, len, NULL, &ec); + int32_t destLen = u_strToUpper(dest, 0, source, len, locale, &ec); ec = U_ZERO_ERROR; dest = (UChar*)uprv_malloc(sizeof(UChar) * MAX(destLen, len)); - u_strToUpper(dest, destLen, source, len, NULL, &ec); + u_strToUpper(dest, destLen, source, len, locale, &ec); if (U_FAILURE(ec)) { uprv_memcpy(dest, source, sizeof(UChar) * len); } @@ -818,7 +817,7 @@ toUpperCase(const UChar* source, int32_t len) { } -// Collect all available currency names associated with the give locale +// Collect all available currency names associated with the given locale // (enable fallback chain). // Read currenc names defined in resource bundle "Currencies" and // "CurrencyPlural", enable fallback chain. @@ -916,7 +915,7 @@ collectCurrencyNames(const char* locale, // Add currency long name. s = ures_getStringByIndex(names, UCURR_LONG_NAME, &len, &ec2); (*currencyNames)[*total_currency_name_count].IsoCode = iso; - UChar* upperName = toUpperCase(s, len); + UChar* upperName = toUpperCase(s, len, locale); (*currencyNames)[*total_currency_name_count].currencyName = upperName; (*currencyNames)[*total_currency_name_count].flag = NEED_TO_BE_DELETED; (*currencyNames)[(*total_currency_name_count)++].currencyNameLen = len; @@ -958,7 +957,7 @@ collectCurrencyNames(const char* locale, // currency long name? s = ures_getStringByIndex(names, j, &len, &ec3); (*currencyNames)[*total_currency_name_count].IsoCode = iso; - UChar* upperName = toUpperCase(s, len); + UChar* upperName = toUpperCase(s, len, locale); (*currencyNames)[*total_currency_name_count].currencyName = upperName; (*currencyNames)[*total_currency_name_count].flag = NEED_TO_BE_DELETED; (*currencyNames)[(*total_currency_name_count)++].currencyNameLen = len; @@ -1366,7 +1365,7 @@ uprv_parseCurrency(const char* locale, int32_t textLen = MIN(MAX_CURRENCY_NAME_LEN, text.length() - start); text.extract(start, textLen, inputText); UErrorCode ec1 = U_ZERO_ERROR; - textLen = u_strToUpper(upperText, MAX_CURRENCY_NAME_LEN, inputText, textLen, NULL, &ec1); + textLen = u_strToUpper(upperText, MAX_CURRENCY_NAME_LEN, inputText, textLen, locale, &ec1); int32_t max = 0; int32_t matchIndex = -1;