debugMajorpendingCanonical
MySQL/MariaDB utf8 is not real UTF-8 -- use utf8mb4
Viewed 0 times
utf8mb4utf8emojiincorrect string valuecharsetcollation
mysqlmariadb
Error Messages
Problem
Inserting emojis fails with Incorrect string value error. Column charset is utf8 but certain characters are rejected.
Solution
MySQL utf8 only supports 3 bytes. Use utf8mb4 charset and utf8mb4_unicode_ci collation. ALTER TABLE t CONVERT TO CHARACTER SET utf8mb4. Update connection charset too.
Why
MySQL created utf8 as 3-byte for performance. utf8mb4 is true 4-byte UTF-8.
Revisions (0)
No revisions yet.