Reputation: 1625
I want to store emojis (android or iphone) in my mysql database, I tried many tutorials and SO posts, on the internet like :
How to insert utf-8 mb4 character(emoji in ios5) in mysql?
http://andy-carter.com/blog/saving-emoticons-unicode-from-twitter-to-a-mysql-database
MySQL utf8mb4, Errors when saving Emojis
I changed all things those tuts require. I have now the following mysql configuration :
character_set_client : utf8mb4
character_set_connection : utf8mb4
character_set_database : utf8mb4
character_set_filesystem : binary
character_set_results : utf8mb4
character_set_server : latin1
character_set_system :utf8
collation_connection : utf8mb4_unicode_ci
collation_database : utf8mb4_unicode_ci
collation_server : latin1_swedish_ci
But I can't still store 4 bits emojis on my mysql database, I have "????", which is pretty annoying.
Please help.
Upvotes: 2
Views: 4541
Reputation: 142208
"4 bytes", not "4 bits".
The column/table needs to be CHARACTER SET utf8mb4
.
<meta charset="UTF8">
, not utf8mb4 -- This is talking to HTML, not MySQL. Outside of MySQL, the proper name is "UTF-8" or "UTF8"; utf8mb4
is a MySQL kludge.
See "question marks" in https://stackoverflow.com/a/38363567/1766831
Exactly 4 question marks implies that the column was not changed. Use ALTER TABLE ... CONVERT TO ...
;
Upvotes: 2