jmadler / emoji-picker

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

How to save emoji in mysql and retrieve them perfect ? #42

Closed planetwebsolution closed 7 years ago

planetwebsolution commented 7 years ago

I am saving unicode of emoji in db. It worked but when I retrieve, it did not work as expected. I can decode from unicode to emoji, it showed normal black and white emojis. I need the emoji image from spritesheet. Any help ?

aminin commented 7 years ago

Hi, @planetwebsolution !

MySQL issues are beyound the scope of this project.

planetwebsolution commented 7 years ago

@aminin Okay but when I choose element.val() I get the unicode value of emoji. That's right but is there anyway to get emoji back from unicode ?

aminin commented 7 years ago

@planetwebsolution, try emojione unicodeToImage

raduca-adrian commented 7 years ago

Hi,

Creating a column as indicated in #51 seems to work for me. Also having the data-emoji-input="unicode" on the input.

TimBest commented 7 years ago

out of scope

dominicklee commented 4 years ago

@aminin Okay but when I choose element.val() I get the unicode value of emoji. That's right but is there anyway to get emoji back from unicode ?

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!