(mysql)我需要什么类型的编码来存储这种字符[重复]

This question already has an answer here:

I'm working on a site which handles user logins through Steam and some usernames can have weird characters in them and whenever I try to update/insert them I get the #1366 - Incorrect string value error. For example I had a query fail because of this:

You need to use utf8mb4 that stands for 4-byte utf8 unicode encoding. You have to make sure:

  • Your application supports this encoding as well.
  • In the machine you want to retrieve data you set SET NAMES utf8mb4 before running any queries.

More information can be found in: https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html