Unicode characters emoticons in MySQL with 4 bytes -


i have insert in mysql strings may contain characters '😂' . tried this:

alter table `table_name` default character set utf8mb4, modify `colname` varchar(200) character set utf8mb4 collate utf8mb4_unicode_ci not null; 

and when insert '😂';

insert `table_name` (`col_name`) values ('😂'); 

i following

select * `table_name`; 

????

how can correct value in select statements?

thanks lot.

you need set connection encoding utf8mb4 well. depends on how connect mysql how this. set names utf8mb4 api-independent sql query so.

what mysql calls utf8 dumbed down subset of actual utf-8, covering bmp (characters 0000 through ffff). utf8mb4 actual utf-8 can encode unicode code points. if connection encoding utf8, data squeezed though subset of utf-8 , cannot send or receive characters above bmp or mysql.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -