Written in frontEnvironment: MySQL 5.7+, MySQL database character encoding is utf8, table is also utf8 Scenario: WeChat authorizes the acquisition of user information (including nickname) and saves it to the database. Some users succeed, but a few fail. So why did it fail? Paste the error log
This is because the failed user's WeChat nickname contains emoji symbols. Analysis: MySQL supports multiple character encoding sets, such as UTF-8, GB2312, GBK, etc. You can view it through the SHOW CHARSET command. We usually recommend using UTF-8 as the default character encoding. From the above figure we can see that the MySQL database has two sets of UTF-8 encoding implementations.
Check the information, official explanation: at lastTips: If you have a field that needs to store emoji symbols, remember to specify the encoding as utf8mb4. This is the end of this article about a small pit in the implementation of MySQL specified encoding. For more relevant MySQL specified encoding content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: An example of using Dapr to simplify microservices from scratch
Table of contents 1. Introduction to Linux system...
As an open source software, Apache is one of the ...
Illustrated CentOS 7.3 installation steps for you...
Jiedaibao is a mobile phone loan software platfor...
Table of contents Importing JavaScript 1. Interna...
This article shares MYSQL logs and backup and res...
1. Add a new user Only allow local IP access crea...
//Default protocol /The use of the default protoc...
Effect picture: Implementation code: <template...
A record of an online MySQL transaction problem L...
Nginx is used as the server, Mongo is used as the...
This article introduces the installation and use ...
Written in front Weibo components are component p...
The first web page I designed is as follows: I ha...
In react-router, the jump in the component can be...