From 99b93d17d53c2d587c45373831b327f7851ec0a8 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 10 Apr 2013 17:13:26 +0900 Subject: Fix a bug where autocorrection status would be wrong. Change-Id: Ic220129dc59f585164dbf63591cd1c96de17fe6f --- java/src/com/android/inputmethod/latin/StringUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/StringUtils.java') diff --git a/java/src/com/android/inputmethod/latin/StringUtils.java b/java/src/com/android/inputmethod/latin/StringUtils.java index 4de104af5..11ef60dc9 100644 --- a/java/src/com/android/inputmethod/latin/StringUtils.java +++ b/java/src/com/android/inputmethod/latin/StringUtils.java @@ -106,16 +106,17 @@ public final class StringUtils { } } - public static String capitalizeFirstCharacter(final String s, final Locale locale) { + public static String capitalizeFirstCodePoint(final String s, final Locale locale) { if (s.length() <= 1) { return s.toUpperCase(locale); } - // Please refer to the comment below in {@link #toTitleCase(String,Locale)}. + // Please refer to the comment below in + // {@link #capitalizeFirstAndDowncaseRest(String,Locale)} as this has the same shortcomings final int cutoff = s.offsetByCodePoints(0, 1); return s.substring(0, cutoff).toUpperCase(locale) + s.substring(cutoff); } - public static String toTitleCase(final String s, final Locale locale) { + public static String capitalizeFirstAndDowncaseRest(final String s, final Locale locale) { if (s.length() <= 1) { return s.toUpperCase(locale); } -- cgit v1.2.3-83-g751a