ICU-7251 test and fix UCharacter.toTitleCase(string with single-letter word, TITLECASE_NO_LOWERCASE)

X-SVN-Rev: 27690
This commit is contained in:
Markus Scherer 2010-02-26 00:24:30 +00:00
parent a6b45a6e9b
commit 48cfc006fe
2 changed files with 13 additions and 5 deletions

View file

@ -4853,9 +4853,9 @@ public final class UCharacter implements ECharacterCategory, ECharacterDirection
appendStr = "J" + appendStr.substring(1);
}
result.append(appendStr);
iter.moveToLimit();
break;
}
iter.moveToLimit();
break;
} else if((nc=iter.nextCaseMapCP())>=0) {
if (isDutch && (nc == 0x004A || nc == 0x006A)
&& (c == 0x0049) && (FirstIJ == true)) {

View file

@ -1,7 +1,7 @@
/**
*******************************************************************************
* Copyright (C) 1996-2008, International Business Machines Corporation and *
* others. All Rights Reserved. *
* Copyright (C) 1996-2010, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
@ -841,7 +841,15 @@ public final class UCharacterCaseTest extends TestFmwk
"\u02bbcAt! \u02bbeTc.",
"",
"-2",
"AL" // Both options
"AL", // Both options
// Test case for ticket #7251: UCharacter.toTitleCase() throws OutOfMemoryError
// when TITLECASE_NO_LOWERCASE encounters a single-letter word
"a b c",
"A B C",
"",
"1",
"L" // U_TITLECASE_NO_LOWERCASE
};