From: Shane Carr Date: Thu, 5 Oct 2017 01:32:05 +0000 (+0000) Subject: ICU-13368 Responding to Markus code review feedback on r40528. X-Git-Tag: release-60-rc~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=011c4fed3a80d9d1156f7ed0ab7290bf51495d5f;p=icu ICU-13368 Responding to Markus code review feedback on r40528. X-SVN-Rev: 40563 --- diff --git a/icu4c/source/common/ucurr.cpp b/icu4c/source/common/ucurr.cpp index df5d973a88c..b7b00cbcebf 100644 --- a/icu4c/source/common/ucurr.cpp +++ b/icu4c/source/common/ucurr.cpp @@ -653,17 +653,13 @@ static UBool fallback(char *loc) { return FALSE; } UErrorCode status = U_ZERO_ERROR; - static const char en_GB[] = { u'e', u'n', u'_', u'G', u'B', 0 }; - if (uprv_strcmp(loc, en_GB) == 0) { + if (uprv_strcmp(loc, "en_GB") == 0) { // HACK: See #13368. We need "en_GB" to fall back to "en_001" instead of "en" // in order to consume the correct data strings. This hack will be removed // when proper data sink loading is implemented here. // NOTE: "001" adds 1 char over "GB". However, both call sites allocate // arrays with length ULOC_FULLNAME_CAPACITY (plenty of room for en_001). - loc[3] = u'0'; - loc[4] = u'0'; - loc[5] = u'1'; - loc[6] = 0; + uprv_strcpy(loc + 3, "001"); } else { uloc_getParent(loc, loc, (int32_t)uprv_strlen(loc), &status); }