jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

converting emoji unicode back to emojis #12

Closed ruchiy48 closed 7 years ago

ruchiy48 commented 8 years ago

While retrieving the emojis from the local database, we get unicode of that particular emoji.How to convert that unicode back to emoji.

libofeng commented 8 years ago

Currently, I use another javascript lib: js-emoji. But the problem is, we need to load ~10M resource when use these 2 javascript lib in my web application.

mayankspatel commented 8 years ago

while retrieving emojis from database. it shows black & white emojis. how can i display colored images in list.

TimBest commented 7 years ago

you should just be able to set input's value to the unicode emojis and the emoji picker will convert it. example: <input type="text" data-emojiable="true" value="😄">

dominicklee commented 4 years ago

Alright guys, I had the same request and need. To convert the unicode versions back into the same images you see in the Picker, you can do:

window.emojiPicker.appendUnicodeAsImageToElement($("#yourDivID"),"😃")

Replace yourDivID with whatever the id of your element. You can also use getElementByID('yourDivID') instead.

Hope this helps someone!