5

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!

lgdroid57
  • 699
  • 14
  • 29
  • What does iOS to Android and vice-versa mean? Via a server? Bluetooth? How? – Simon Aug 08 '13 at 20:45
  • By the way, an example of my encoding is: http://stackoverflow.com/questions/7360403/base-64-encode-and-decode-example-code/7360440#7360440 – lgdroid57 Aug 09 '13 at 18:08
  • There is a number of emoji that is Apple-only because they're not part of the Unicode standard: http://apps.timwhitlock.info/emoji/tables/missing – caw Mar 19 '14 at 00:17

1 Answers1

2

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

lgdroid57
  • 699
  • 14
  • 29
  • Could you please write more details about your library, what it does and how it works, all I can see in EmojiTextView.java is that you're applying StringEscapeUtils.unescapeJava to the text. – Ali Alnoaimi Aug 14 '13 at 21:58
  • 1
    Sorry! StringEscapeUtils is part of a java library which is not part of the android library. My library imports the missing library and removes the escape characters properly. For example, ":-)" gets escaped as "\ud83d\ude03". EmojiTextView.setTextWithEmojis converts "\ud83d\ude03" to ":-)". – lgdroid57 Aug 30 '13 at 21:41
  • 1
    I just synched a new version which has a helper class for encoding and decoding the emoticons as I have mentioned – lgdroid57 Aug 30 '13 at 21:57
  • Thanks for this! I haven't looked into it, but it is something on my next release milestone. – eric Mar 29 '17 at 17:24
  • Hi @eric. I haven't touched the code base in a while, so please let me know if you encounter any issues. :) – lgdroid57 Mar 29 '17 at 17:39