Mysql, emoji, and special characters, mysqlemoji

Source: Internet
Author: User

Mysql, emoji, and special characters, mysqlemoji

Since login is a very common login method, relevance should also be considered during database design. Generally, it is enough to store open_id, icons, and nicknames. Special attention should be paid to the nickname, otherwise it may be like this:

Mysql: 1366 Incorrect string value ......

This is because nicknames use special characters, such as the UNICODE emoji extension zone. Mysql utf8 default cannot be stored, and the number of digits is insufficient. Reference: 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' (text varchar (20) CHARSET utf8mb4) begin select text; END

 

To test this problem, you can use:

Select unhex ('f09f8d83 ')

Or

INSERT tb ('text') VALUES (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

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.