1

I am having a Whatsapp chat txt file inside of which emojis have been replaced by such text------> "���"

I want to convert that text to specifics emojis. How can I do that and use it inside a java application?

Aurasphere
  • 3,841
  • 12
  • 44
  • 71
Sumeet
  • 87
  • 1
  • 10

2 Answers2

2

As @Abhishek pointed out, you need to use a different type of encoding. Whatsapp does backup with UTF-8 converting the emoticons into string representations. If you want to see the real emoji, you will have to use Unicode instead. Unicode contains sections which specify emoji as "characters". They're regular characters, you only need a font which can display them. Also see the Unicode Emoji FAQ.

In a text file, characters are basically encoded as numbers in the form of bytes. To display those visually on a computer screen you need a font which contains the visual glyph to render this character. Since the process is always numeric identifier → font → visible glyph, it should be pretty obvious that a "character" can be anything visual, including emoji or any other image.

Aurasphere
  • 3,841
  • 12
  • 44
  • 71
  • You asked how to convert the emojis back. The answer is: use a different encoding. You asked: can anyone tell me what is correct encoding for this, I replied: Unicode. So, how is this not useful and exisisting already? – Aurasphere Apr 22 '16 at 10:41
  • I was in an hurry and I found what you were looking for on another post, so I copy-pasted. If this bothers you so much I'm deleting the answer. – Aurasphere Apr 22 '16 at 11:36
1

Maybe all you need is a a font which contains the visual glyph to render these characters. See this for reference.

Community
  • 1
  • 1
Tony Vincent
  • 13,354
  • 7
  • 49
  • 68