mervick / emojionearea

Emoji Picker Plugin for jQuery
https://jsfiddle.net/mervick/1v03Lqnu/765/
MIT License
953 stars 257 forks source link

emoji do not render properly. #394

Closed Hetashah2498 closed 3 years ago

Hetashah2498 commented 4 years ago

Hello, i am using emojionearea 3.4.1 version. everything is working fine but some of emoji do not render properly. Ex. if i select people swimming emoji from emoji panel and then i save so in database it stores something different and render different once i load data from database. this response is also send to mobile developers so they also not getting same emoji. sometimes there is question mark comes. Hoping for your reply soon. This is how it showing right now 1) when i select : https://prnt.sc/rqq9zh 2) when it store in database : https://prnt.sc/rqqauk 3) when get back from database : https://prnt.sc/rqq86m

mervick commented 4 years ago

Hello. What database are you using? You should use full utf8 encoding to store emojis. If your database is mysql, then you should use utf8mb4 encoding, utf8 encoding in mysql is something different.

Hetashah2498 commented 4 years ago

Yes, i am using mysql and i am using utf8mb4. some of the emojis like faces, food emojis are working fine but sports emoji or flag emoji's are facing issue i mentioned above.

mervick commented 4 years ago

Can you give me the text of the what you get from the database?

Hetashah2498 commented 4 years ago

Yes, in my database it stores something like : https://prnt.sc/rqtgng but if i paste text here it looks perfect see : 🏊♀🤣 but there is one symbol between both this emoji and wait what is see in my text area is : https://prnt.sc/rqtiau

i do not know is this any device or browser issue ? i am actually not getting this.

mervick commented 4 years ago

From what you gave me, I concluded the following

Note UTF8 HEX
wrong (from your database) 🏊♀ F0 9F 8F 8A E2 99 80
right 🏊‍♀️ F0 9F 8F 8A E2 80 8D E2 99 80 EF B8 8F

So, definitely, where along the way characters lose their part. You need to debug/log what you put in the database and what you get from where.

I guess, it's a database issue. Looks like it's a cropped utf8 instead of utf8mb4

Hetashah2498 commented 4 years ago

yes i checked it before but my table my filed all are in utf8mb4_unicode_ci

mervick commented 4 years ago

Try to debug/log

mervick commented 4 years ago

Also, issue may be your PHP connection to Mysql. Make sure is that the connection encoding between PHP and MySQL is set to utf8mb4 too.

ref https://stackoverflow.com/a/16893103/1772410

Hetashah2498 commented 4 years ago

Thank you, i will check this and as i debug the code in input it is taking wrong so database tore the same wrong input and it render wrong in output as well. https://prnt.sc/rracfi see so this happening before it enter into the database so i don't think so it is issue from database encoding still i will check that connection one. my code: $("#description").emojioneArea({ pickerPosition: "bottom", filtersPosition: "bottom", tonesStyle: "checkbox", recentEmojis: false, search: false, });

Pavel-Pavek commented 4 years ago

Hi, was this isue solved? I have the same problem with the newest Emojionarea, MySQL is utf8mb4_unicode_ci and PHP connection is utf8mb4. But like Hetashah2498 wrote, the problem is even before I send it to database, not what PHP or DB do... Some Emojis are allright, like "person playing water polo", but if I pick "men (or woman) playing water polo" immediately in the textarea I can see Emoji for "person playing water polo" + gender Emoji. The same is with judge and another icons. Flags are OK. If I save this to DB, emojione will display 2 icons, like I described. I tried Emojis from JoyPixel an Twitter, with both I have the sam problem.

mervick commented 3 years ago

@Pavel-Pavek your issue is related with emojione parser issue