Problems inserting Emoji in mySQL

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 it correctly? Is it PHP?

    
asked by anonymous 06.06.2014 / 18:47

1 answer

3

ATTENTION: THIS ANSWER IS NOT FROM MY AUTHORSHIP, HAS BEEN TRANSLATED FROM

p>

TO HELP THE QUESTION AUTHOR, IF THE SAME DOES NOT HAVE THE ENGLISH LANGUAGE KNOWLEDGE.

Unicode 4-byte characters are not much 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 are a few things to check:

Make sure that the default character set of your tables and text fields are converted to uft8mb4 , and client configuration and server characters, eg.

ALTER TABLE nomeDaTabela charset=utf8mb4;

MODIFY COLUMN nomeDaTabela VARCHAR(255) CHARACTER SET utf8mb4;

MODIFY COLUMN nomeDaTabela VARCHAR(255) CHARACTER SET utf8mb4;

And so it goes ...

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

Always remember to make a backup before you change anything.

Also, make sure your application uses the database connection with utf8mb4 character support. Another thing, look at the version of mySQL you are using, if it is old, upgrade it.

When checking your data from a mySQl client, make sure your device can display 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 problems.

    
07.08.2014 / 15:23