Label:http://www.v2ex.com/t/137724 If you want your website or App to support Emoji, there are some details you need to know when setting up MySQL for the first time.EmojiThe special point of the Emoji character is that it takes 4 bytes to store it. This collate of the UTF8 character set, which is common in MySQL, utf8_general_ci supports only 3 bytes. So to be able to store
Label:
Insert emoji expression in MySQL, error occurred:
Java.sql.SQLException:Incorrect string value: ' \xf0\x9f\x98\x8a ' for column ' content ' at rowThe reason is that the current MySQL character set is Utf-8, up to 3 bytes, and the emoji expression takes 4 bytes to represent. So the insert error is caused.The general approach is to change the character set to UTF8MB42. Utf8mb4 such a char
Tags: http color ingest scene href character type data sdn1. First introduce the following commonly used character sets
ASCII: United States Information Interchange standard coding; English and other Western European languages; single-byte encoding, 7-bit represents a character, a total of 128 characters.
GBK: Double-byte, Chinese character code expansion specification; Chinese, Japanese and Korean characters, English, numerals, double-byte encoding, a total of 21,003 Chinese charac
MySQL does not show emoji expression or display?? , the reason is not explained here, directly to say the solution. (mainly modified UTF8MB4)1. Modify the table2. Modifying fieldsALTER TABLE ' table_name ' MODIFY COLUMN ' column_name ' varchar CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;3. CharSet when modifying client connectionsExample: In thinkphp, when you configure a link database parameter, ' db_charset ' = ' utf8mb4 'Do here, basically al
Why do you want to set the database charset to UTF8MB4? UTF8 used to be all the time? The answer is here: UTF8 for Internet interactions that do not use mobile devices, UTF8MB4 is suitable for the current mobile device Internet development, as mobile devices often have emoji (emoji) storage, which consumes 4 bytes of storage space, while UTF8 is 3 bytes, so that With 3 bytes to store 4 bytes of things, it i
Let MySQL support Emoji expressions. We recommend that you use the utf8mb4 character set in advance for MySQL databases involving wireless connections. What is the difference between utf8mb4 and utf8? Previous
Let MySQL support Emoji expressions. We recommend that you use the utf8mb4 character set in advance for MySQL databases involving wireless connections. What is the difference between utf8mb4 and utf8?
Enable MySQL 5.6 to support Emoji expressions
Let MySQL support Emoji expressions. We recommend that you use the utf8mb4 character set in advance for MySQL databases involving wireless connections.
MySQL 5.6
1 solution: Convert Mysql encoding from utf8 to utf8mb4.
Required> = MySQL 5.5.3 and slave database must also be 5.5. Earlier versions do not support this character set or duplicate error.
2 Add the my.
Tags: User Client SQ byte theory ase nbsp Problem collateMySQL added this UTF8MB4 code after version 5.5.3, Mb4 is the most bytes 4 meaning, specifically for compatibility with four-byte Unicode. In fact, UTF8MB4 is a superset of UTF8, theoretically using UTF8, and then modifying the character set to UTF8MB4, will not have any problems with the existing UTF8 encoded reads. Small program of the project, found to save the user information nickname times wrong, looking for reasons to find that some
Tags: mysql problem special character icon Lam value div with timingSince the landing was already very popular in the way of landing, the relevance should also be considered in database design. General storage open_id, icons, nicknames is enough. The nickname should be special attention, otherwise it might be like this: mysql:1366 incorrect string value bar bar ... This is because the nickname uses special characters, such as the Unicode emoji extensi
let MySQL support emoji emoticons, involving wireless-related MySQL database recommendations are in advance with the UTF8MB4 character set. MySQL version 5.61 solution: Convert the MySQL encoding from UTF8 to UTF8MB4.Requires >= MySQL 5.5.3 version, from the library must be 5.5, the lower version does not support this character set, copy error2 my.cnf File added [Mysqld]character-set-server = Utf8mb4collation-server = Utf8mb4_unicode_ciinit_connect= '
21,003 Chinese characters, GB2312 extension.
Utf-8:unicode standard variable length character encoding, Unicode Standard (Uniform code), industry uniform standards, including the world's dozens of kinds of text system;
UTF-8: Encode each character using one to three bytes.
Utf8mb4: Stores four bytes, and the application is used to store emoji emoticons because it can have emoji four bytes of
http://my.oschina.net/jiemachina/blog/189460Note that the replacement of these emoji is the standard expression characters, each expression is originally 2 bytes, replaced by a string, each expression becomes 12 characters, wasted a lot of space, but simple, do not need to write a map one by one corresponding;Turn the expression into a stringdef Filter_emoji (desstr,restr= "):‘‘‘Filter Emoticons‘‘‘TryCO = re.compile (U ' [\u00010000-\u0010ffff] ')Exce
caused By:java.sql.SQLException:IncorrectstringValue'\xf0\x9f\x98\x84' forColumn' nickname'At row1At com.mysql.jdbc.SQLError.createSQLException (Sqlerror.java:1074) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (Mysqlio.java:4096) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (Mysqlio.java:4028) at Com.mysql.jdbc.MysqlIO.sendCommand (Mysqlio.java:2490) at Com.mysql.jdbc.MysqlIO.sqlQueryDirect (Mysqlio.java:2651) at Com.mysql.jdbc.ConnectionImpl.execSQL (Connectionimpl.java:2734) at Com.mysql.jdbc.Pre
Tags: mysqld ble ini Beauty's name technology SRC user RACThe records of this blog are operated on LinuxThe project needs to log in from obtaining authorization, and in this process, there was an error saving the emoji emoticons to the MySQL database.The usual Baidu, learned that the UTF8 character set is MySQL only supports 1-3-byte characters, and the expression needs 4 bytes, so MySQL provides a utf8mb4 character set, in support of 4 bytes at the s
Statement: My articles are all written after I have encountered and solved the problem in my actual work. You may have been clear for a long time or have no help for you. If you like them, please stick to them first, do not spray either. Just like football, if you don't like Chinese football, don't worry about it. You can watch table tennis, badminton, or even curling! But don't scold them. After all, there are still many people who love Chinese football. I am one of them. I recently worked on a
How to enable MySQL to store emoji characters,
MySQL must support emoji Versions later than 5.5.3, and set the character set to utf8mb4.
What is the difference between utf8mb4 and utf8? In the past, mysql utf8 had a maximum of 3 characters, while utf8mb4 was extended to a single character with a maximum of 4 bytes. Therefore, more character sets are supported.
Converts the Mysql code from utf8 to utf8mb4.
R
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.