Switched capitalize back to using toTitleCase. Added a test for this using the 'Lj' letter. LANG-1142

This commit is contained in:
Henri Yandell 2015-07-19 01:25:10 -07:00
parent cc1aed9bdf
commit 421db380d0
2 changed files with 4 additions and 1 deletions

View File

@ -5765,7 +5765,7 @@ public class StringUtils {
}
final char firstChar = str.charAt(0);
final char newChar = Character.toUpperCase(firstChar);
final char newChar = Character.toTitleCase(firstChar);
if (firstChar == newChar) {
// already capitalized
return str;

View File

@ -250,6 +250,9 @@ public class StringUtilsTest {
assertEquals("capitalize(string) failed",
FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
assertEquals("capitalize(String) is not using TitleCase",
"\u01C8", StringUtils.capitalize("\u01C9"));
// Javadoc examples
assertNull(StringUtils.capitalize(null));
assertEquals("", StringUtils.capitalize(""));