Open Johnibur opened 3 years ago
I meet with the same problem, and found another emoji ❤️ missing with the variation selector character (\uFE0F)
directly removing all variation selectors may helps
// remove Variation Selectors for Emoji glyph
StringBuilder sb = new StringBuilder();
for (char ch : sentenceText.toCharArray()) {
Character.UnicodeBlock ub = Character.UnicodeBlock.of(ch);
if (ub != Character.UnicodeBlock.VARIATION_SELECTORS && ub != Character.UnicodeBlock.VARIATION_SELECTORS_SUPPLEMENT) {
sb.append(ch);
}
}
sentenceText = sb.toString();
Some emojis are missing the variation selector character (\uFE0F) used to specify a glyph to be applied to a preceding character, which makes them systematically fail the parsing test.
This first commit adds the missing character selectors for keycap enclosing digits. But there is likely to have such characters missing for other emojis.