I make a query using the mysql workbench to create a table and insert 1 record that contains a 4 byte emoji using:
SET NAMES utf8mb4; CREATE TABLE IF NOT EXISTS tbl_message message_message
VARCHAR(1000) DEFAULT CHARSET=utf8mb4;
INSERT INTO 'tbl_message message_message VALUES ('Hello ');
When I query the data it is correct and shows a data length of 10 bytes. When I close mysql workbench and go back the record shows 'Hello ?' and a data length of 7 bytes.
My my.cnf shows:
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci
What is causing the 4 byte emoji to change to a 3 byte ?