am c4dfa998: am d2a99617: am c94a9998: Merge "JPtextinput: Dont break emoji characters when cutting strings."
* commit 'c4dfa998b7660b9afc4d41b0c940d798f2122fc3': JPtextinput: Dont break emoji characters when cutting strings.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user