Emoji insertion problems in mysql

Asked

Viewed 1,733 times

0

I’m having trouble inserting EMOJI emoticons into mysql, it inserts "????" for each Emoticon.

My table is already as utf8mb4_bin how do I insert correctly? It will be PHP?

1 answer

3



ATTENTION: THIS ANSWER IS NOT MY OWN, WAS TRANSLATED FROM

https://stackoverflow.com/questions/7814293/how-to-insert-utf-8-mb4-characteremoji-in-ios5-in-mysql

TO ASSIST ME IF I DO NOT HAVE THE KNOWLEDGE OF THE ENGLISH LANGUAGE.


4-byte Unicode characters are not widely used, so it’s not every application that has full support for them. mysql 5.5 works well with them, if properly configured - see if the other components work with it as well.

Here is a list of some things to check:

Make sure your tables' default character settings and text fields are converted to uft8mb4, and the client configuration and server characters, e.g..

ALTER TABLE nomeDaTabela charset=utf8mb4;

MODIFY COLUMN nomeDaTabela VARCHAR(255) CHARACTER SET utf8mb4;

MODIFY COLUMN nomeDaTabela VARCHAR(255) CHARACTER SET utf8mb4;

and so on...

If your data is already in utf8, it can be converted to uft8mb4 without problems.

Remember to always back up before changing anything.

Also, make sure your app uses the database connection with character support utf8mb4. Another thing, see the version of mysql you’re using, if it’s old, update it.

When checking your data from a mysql client, make sure your device can show emoji and run a SET NAMES utf8mb4 before using any query.

When each level of your application can accept the new characters, you can use them without any problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.