Problems inserting Emoji in mySQL

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? Will it be PHP?

Author: Guilherme Nascimento, 2014-06-06

1 answers


Attention: THIS ANSWER IS NOT MY OWN, IT WAS TRANSLATED FROM

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

TO ASSIST THE QUESTIONER, IF THE QUESTIONER DOES NOT HAVE KNOWLEDGE OF THE ENGLISH LANGUAGE.


4 byte Unicode characters are not much used, so not every application 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 that the default character configuration of your tables 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 may be converted to uft8mb4 without problems.

Remember to always make a copy of security before changing anything.

In addition, make sure that your application uses the database connection with character Support utf8mb4. Another thing, see the version of mySQL you are using, if it is old, make an update of 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 app can accept the new characters, you will be able to use them without any problem.

 3
Author: John Calistro, 2017-06-29 15:27:21