In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you what the problem of saving mysql into emoji emoticons is like, the content is concise and easy to understand, and it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
1. Test insert script
'\ xF0\ x9F\ x92\ x94' for column' name' at row 1
If you modify the character set online
Mysql > ALTER TABLE testtab CONVERT TO CHARACTER SET utf8mb4
Query OK, 0 rows affected (0.34 sec)
Records: 0 Duplicates: 0 Warnings: 0
Mysql > alter table testtab modify column `contents` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
Query OK, 0 rows affected (0.36 sec)
Records: 0 Duplicates: 0 Warnings: 0
Run the insert script
View data
Mysql > select * from testtab
+-+
| | contents |
+-+
| | |
| | |
| | hello |
|? hello |-this one should be normal, four? It should be garbled.
+-+
Note:
This is right.
On the premise, the difference between utf8mb4 and utf8 is that utf8 only uses 3-bit bytecode to store data, while utf8mb4 uses 4-bit bytecode to store data.
Emoji emoji is a 4-bit bytecode escaped through the preceding paragraph, which itself is an unreadable character, so it will display "?" in the database client. .
The emoji emoji will be displayed where emoji is supported on the front end.
If you want to insert emoji emoticons in the context of utf8, you have to modify the configuration file and restart the database.
The above is the question of how mysql stores emoji emoticons. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.