Emoji expressions cannot be inserted into MySQL _ MySQL

Source: Internet
Author: User
Emoji expressions can not insert MySQL IOS end data through PHP passthrough to the background C ++, on the PHP system will automatically transcode Unicode into a UTF-8.
UTF-8-encoded emoji expressions cannot be inserted into MySQL.

After analysis, it is found that emoji expression is Unicode6.1 introduced, into the UTF-8 for four bytes of encoding, rather than like Chinese characters, the UTF-8 is 3 bytes. In MySQL, if you select the storage mode for the longext field storage is unable to process the four-byte UTF-8 encoding, only utf8mb4 encoding mode supports 4-byte UTF-8 encoding. So select utf8mb4 encoding method, mysql can store 4 bytes of UTF-8 encoding, so as to store emoji expressions. MySQL must be upgraded to version 5.5.

But the encoding stored in MySql although the back shell to store 4 bytes of UTF-8 encoding, but can not be successfully displayed, because the stored is garbled. So you need to convert the UTF-8 to Unicode and then save it to MySQL.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.