mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-13574 Revising codePointZero loading based on feedback.
X-SVN-Rev: 41082
This commit is contained in:
parent
4a5c8afa5b
commit
8da6ef1776
1 changed files with 13 additions and 9 deletions
|
@ -437,15 +437,19 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status,
|
|||
sink.resolveMissingMonetarySeparators(fSymbols);
|
||||
|
||||
// Resolve codePointZero
|
||||
const UnicodeString& stringZero = getConstDigitSymbol(0);
|
||||
UChar32 tempCodePointZero = stringZero.char32At(0);
|
||||
if (u_isdigit(tempCodePointZero) && stringZero.countChar32() == 1) {
|
||||
for (int32_t i=0; i<=9; i++) {
|
||||
const UnicodeString& stringDigit = getConstDigitSymbol(i);
|
||||
if (stringDigit.char32At(0) != tempCodePointZero + i || stringDigit.countChar32() != 1) {
|
||||
tempCodePointZero = -1;
|
||||
break;
|
||||
}
|
||||
UChar32 tempCodePointZero;
|
||||
for (int32_t i=0; i<=9; i++) {
|
||||
const UnicodeString& stringDigit = getConstDigitSymbol(i);
|
||||
if (stringDigit.countChar32() != 1) {
|
||||
tempCodePointZero = -1;
|
||||
break;
|
||||
}
|
||||
UChar32 cp = stringDigit.char32At(0);
|
||||
if (i == 0) {
|
||||
tempCodePointZero = cp;
|
||||
} else if (cp != tempCodePointZero + i) {
|
||||
tempCodePointZero = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fCodePointZero = tempCodePointZero;
|
||||
|
|
Loading…
Add table
Reference in a new issue