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
In the course of work, you will encounter many ca...
In Vue, we can define (register) local components...
First look at the effect: When the mouse moves ov...
Install lua wget http://luajit.org/download/LuaJI...
1. Problem introduction Assume a scenario where a...
This article example shares the specific code of ...
Syntax format: row_number() over(partition by gro...
A Brief Discussion on the Navigation Window in If...
This error is often encountered by novices. This ...
Overview: Oracle scott user has four tables, whic...
Table of contents 1 What is container cloud? 2 In...
Learn about similar methods for getting character...
You can use the command: docker tag [image id] [n...
Table of contents Preface concept Stabilization d...
This article uses examples to illustrate the usag...