问题
I'm currently developing a keyboard for android , and i found out some emojis take 2 chars and some take 1 char ,
Is there a way to differ between the two if they are in a string ?
回答1:
Ok i managed to solve this issue by using this lib
https://github.com/vdurmont/emoji-java
in there , there is a isEmoji(string)
String currentTextStr = currentText.toString().substring(currentText.length() - 2);
Log.e("emojicon",""+EmojiManager.isEmoji(currentTextStr));
回答2:
Currently seeing the pattern - if emoji doesn't have browser version of it, then that libs isEmoji()
function fails to recognize emojis, like Nr. 927, Nr. 938: http://www.unicode.org/emoji/charts/full-emoji-list.html
来源:https://stackoverflow.com/questions/41609277/android-emojis-char-size