表情符号支持iOS和Android [英] Emoji Support for iOS and Android

查看:179
本文介绍了表情符号支持iOS和Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为帖子中的emoji支持开发适用于iOS和Android的应用程序。目前我使用UTF-8编码和解码String(text& / emoji)。它本身可以工作,Android到Android和iOS到iOS,但从Android - > iOS或iOS - > Android它并不总是有效。偶尔会丢失一些表情符号,其余字符串(任何实际文本)在这些情况下都会丢失。

I am trying to develop an application for both iOS and Android with emoji support in posts. Currently I am Base64 encoding and decoding the String (text &/ emoji) with UTF-8. It seems to work natively, Android-to-Android and iOS-to-iOS, but from Android -> iOS or iOS -> Android it doesn't always work. There are occasionally a few emojis missing, and the rest of the string (any actual text) is lost in these instances.

注意:我了解不同的设备有不同的表情符号,所以我并不担心偶尔失踪的表情符号,但是丢失的文字困扰着我,我注意到同一台设备上有一个表情符号丢失。

Note: I understand different devices have different emojis, so I am not as worried about occasional missing emojis, but the missing text bothers me, and I noticed a missing emoji on the same device.

有没有人有任何想法或知道更好的解决方案吗?谢谢!

Does anyone have any ideas or know of any better solutions? Thanks!

推荐答案

我设法搞清楚了。我们不再编码或解码字符串。相反,我修改了Android中的TextView以重新格式化字符串,以便显示文本和表情符号。我根据我的解决方案创建了一个非常简单的库。 https://github.com/will5/EMOJITextView

I managed to figure it out. We are no longer encoding or decoding the string. Instead, I modified the TextView in Android to re-format the string so that both the text and the emojis display. I made a very simple library based on my solution. https://github.com/will5/EMOJITextView

这篇关于表情符号支持iOS和Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆