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
reduce method is an array iteration method. Unlik...
Copy code The code is as follows: <object id=&...
Preface In databases such as Oracle and SQL Serve...
<br />When you click the link, the web page ...
Table of contents 1. Customize the network to rea...
Table of contents Preface 【undo log】 【redo log】 【...
HTML text formatting tags 標簽 描述 <b> 定義粗體文本 ...
Preface Most of our MySQL online environments use...
This article collects the fonts used in the logos...
In the previous article, I introduced the detaile...
UPD 2020.2.26 Currently Ubuntu 20.04 LTS has not ...
This article example shares the specific code of ...
This article shares the specific implementation c...
Preface When we write web pages, we will definite...
Write configuration files in server.xml and conte...