am c94a9998: Merge "JPtextinput: Dont break emoji characters when cutting strings."

* commit 'c94a99987d8a49ea599c22ffad0e61db591963e0':
  JPtextinput: Dont break emoji characters when cutting strings.
This commit is contained in:
Kenny Root
2011-02-04 16:01:13 -08:00
committed by Android Git Automerger

View File

@@ -88,7 +88,14 @@ public interface InputFilter
} else if (keep >= end - start) {
return null; // keep original
} else {
return source.subSequence(start, start + keep);
keep += start;
if (Character.isHighSurrogate(source.charAt(keep - 1))) {
--keep;
if (keep == start) {
return "";
}
}
return source.subSequence(start, keep);
}
}