MySQL with emoji and special characters

Source: Internet
Author: User

Since 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 extension area. MySQL UTF8 default is not stored, the number of bits is insufficient. Reference: attached link 1

The corresponding field should be modified to UTF8MB4, and the parameters of the stored procedure should also be modified (link 2):

CREATE PROCEDURE ' emoji ' (textvarchar() CHARSET utf8mb4)BEGIN    SELECTtext; END

To test this problem can be used:

Select unhex ('f09f8d83')

Or

INSERT TB ('textVALUES' (Unhex ('f09f8d83'))

Link 1:http://www.cnblogs.com/lampbrotherit/p/5794742.html

Link 2:https://stackoverflow.com/questions/17650662/creating-a-stored-procedure-with-utf8-strings

MySQL with emoji and special characters

Related Article

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.