safx / Emoji-Swift

String extension converting to and from emoji character and Emoji-One

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

❤️ shows as :heart:️

pareekkhushboo77 opened this issue · comments

I Entered text as - Spread love and happiness ❤️

When escaped - Spread love and happiness : heart : ï¸
When unescaped - Spread love and happiness ❤️ ï¸

Why does it adds ï. at the end of some emojis.

Hi @pareekkhushboo77 , i've been playing with the pod and found that there is a problem with some of the emojis given in emojis dictionary. Numbers and heart and ,people say, about 60 more emojis have variation selector that prevents this lib from parsing emojis correctly.
See kindly attached the link:
mathiasbynens/emoji-regex#3

commented

Sorry about the lazy reply.
As @SergeyPetrachkov mentioned above, this is caused by VARIATION SELECTOR-16 (U+FE0F).
I'll try to fix this, but I don't know how many emojis have variations at this time.

If you want to fix right now, please use custom emoji like this:

var emojiDictionary = String.emojiDictionary
emojiDictionary["heart_alt"] = "\u{2764}\u{fe0f}"
String.emojiDictionary = emojiDictionary

EDIT: I've found emoji variations at http://unicode.org/Public/emoji/5.0/emoji-variation-sequences.txt