unicode - Incorrect string value: '\xF0\x9F\x92\x8F\x0A#...for column in mysql? -


i new mysql. have column stores unicode character in mysql table.

i have code gets posts twitter,facebook etc. , insert text/symbol 'as is' table.

create table `tbl_unicode` (   `_id` smallint(5) unsigned not null auto_increment,   `first_name` varchar(45) not null,   `uninoce_column` varchar(200) character set utf8 collate utf8_unicode_ci not null,   primary key (`_id`)  ) engine=innodb auto_increment=201 default charset=utf8;   /* query wont work due symbol:💏   */ insert `tbl_unicode`   (`_id`,   `first_name`,   `uninoce_column`) values   (2,   'rakesh',   '最高の休日💏 #京都#宮津#天の橋立#');   /* query works fine */ insert `tbl_unicode`   (`_id`,   `first_name`,   `uninoce_column`) values   (1,   'shekhar',   '最高の休日 #京都#宮津#天の橋立#'); enter code here 

live demo in sqlfiddle

so, datatype or configuration should make work.

any suggestions?

character set utf8

mysql's utf8 charset not utf-8. easy! instead, it's limited subset of utf-8 code points u+00ffff, can stored in 3 utf-8 bytes, supported. 💏 u+01f48f, doesn't fit in table's charset.

the real utf-8 character set known in mysql (5.5 , later) utf8mb4.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -