mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-176 numDisplayCells() UTF-16 enabled
X-SVN-Rev: 1081
This commit is contained in:
parent
e542c7dedc
commit
0399573487
1 changed files with 2 additions and 3 deletions
|
@ -336,12 +336,12 @@ UnicodeString::numDisplayCells( UTextOffset start,
|
|||
// pin indices to legal values
|
||||
pinIndices(start, length);
|
||||
|
||||
UChar c;
|
||||
UChar32 c;
|
||||
int32_t result = 0;
|
||||
UTextOffset limit = start + length;
|
||||
|
||||
while(start < limit) {
|
||||
c = getArrayStart()[start];
|
||||
UTF_NEXT_CHAR(fArray, start, limit, c);
|
||||
switch(Unicode::getCellWidth(c)) {
|
||||
case Unicode::ZERO_WIDTH:
|
||||
break;;
|
||||
|
@ -358,7 +358,6 @@ UnicodeString::numDisplayCells( UTextOffset start,
|
|||
result += (asian ? 2 : 1);
|
||||
break;
|
||||
}
|
||||
++start;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Add table
Reference in a new issue