1

As mentioned in Emoji in strings.xml file? you need to use Unicode smileys like these:

https://apps.timwhitlock.info/emoji/tables/unicode

as HTML Entity but why didn't he mentioned how to convert them to HTML Entity.

I tried all kind of online converters like https://www.online-toolz.com/tools/text-html-entities-convertor.php but they don't convert stuff like U+1F601 to anything.

Can someone enlighten me?

Frank Bank
  • 13
  • 2

2 Answers2

1

This is easier than you might think: U+1F601 corresponds to 😁.

Henry
  • 42,982
  • 7
  • 68
  • 84
0

Slight modification to Henry's answer, You may use as follows.

<string name="hello_world">Hello world! &#128513;</string>
// this is using in decimal

But I have found that it is giving run time errors in Lollipop and below. It works on marshmallow and above.

SHS
  • 1,414
  • 4
  • 26
  • 43
  • But how you get 😁 from U+1F601 in the first place? – Frank Bank Nov 14 '18 at 14:22
  • If you do not wish to do it programmatically then you may visit the following link. You can see the end of string as U+1F601 to convert specific character. This link has "HTML Entity: " section where you can get the decimal converted or hex converted value. https://www.compart.com/en/unicode/U+1F601 – SHS Nov 15 '18 at 04:45
  • for programatically in java ... int decimal=Integer.parseInt("1F601",16); – SHS Nov 15 '18 at 04:49