Switched capitalize back to using toTitleCase. Added a test for this using the 'Lj' letter. LANG-1142
This commit is contained in:
parent
cc1aed9bdf
commit
421db380d0
|
@ -5765,7 +5765,7 @@ public class StringUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
final char firstChar = str.charAt(0);
|
final char firstChar = str.charAt(0);
|
||||||
final char newChar = Character.toUpperCase(firstChar);
|
final char newChar = Character.toTitleCase(firstChar);
|
||||||
if (firstChar == newChar) {
|
if (firstChar == newChar) {
|
||||||
// already capitalized
|
// already capitalized
|
||||||
return str;
|
return str;
|
||||||
|
|
|
@ -250,6 +250,9 @@ public class StringUtilsTest {
|
||||||
assertEquals("capitalize(string) failed",
|
assertEquals("capitalize(string) failed",
|
||||||
FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
|
FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
|
||||||
|
|
||||||
|
assertEquals("capitalize(String) is not using TitleCase",
|
||||||
|
"\u01C8", StringUtils.capitalize("\u01C9"));
|
||||||
|
|
||||||
// Javadoc examples
|
// Javadoc examples
|
||||||
assertNull(StringUtils.capitalize(null));
|
assertNull(StringUtils.capitalize(null));
|
||||||
assertEquals("", StringUtils.capitalize(""));
|
assertEquals("", StringUtils.capitalize(""));
|
||||||
|
|
Loading…
Reference in New Issue