ICU-1501 fix to handle surrogates

X-SVN-Rev: 7258
This commit is contained in:
Alan Liu 2001-12-01 22:37:34 +00:00
parent dafa4debfb
commit 514ea083f8

View File

@ -105,9 +105,10 @@ void TitlecaseTransliterator::handleTransliterate(
// in which case we want to start in toLower mode. If the
// prior context is anything else (including empty) then start
// in toTitle mode.
int32_t start = offsets.start;
while (start > offsets.contextStart) {
UChar c = text.charAt(--start);
UChar32 c;
int32_t start;
for (start = offsets.start - 1; start >= offsets.contextStart; start -= UTF_CHAR_LENGTH(c)) {
c = text.char32At(start);
if (SKIP->contains(c)) {
continue;
}