8228352: CANON_EQ breaks when pattern contains supplementary codepoint

Reviewed-by: naoto
This commit is contained in:
Ivan Gerasimov 2019-08-01 07:14:03 -07:00
parent 465eff703f
commit 66dc6cf25b
2 changed files with 13 additions and 2 deletions

View file

@ -1506,7 +1506,7 @@ public final class Pattern
String seq = src.substring(off, j);
String nfd = Normalizer.normalize(seq, Normalizer.Form.NFD);
off = j;
if (nfd.length() > 1) {
if (nfd.codePointCount(0, nfd.length()) > 1) {
ch0 = nfd.codePointAt(0);
ch1 = nfd.codePointAt(Character.charCount(ch0));
if (Character.getType(ch1) == Character.NON_SPACING_MARK) {