Android emojis char size

♀尐吖头ヾ 提交于 2019-12-12 04:33:23

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!