Configure the insert of emoji characters and insert of emoji characters
An error is reported when a character is inserted in a recently created Project.
ERROR 1366: 1366: Incorrect string value: '\xF0\x9D\x8C\x86' for column 'vl' at row 1
After struggling for several hours, I solved it ~~ You only need to convert utf8 to utf8mb4.
This problem is actually not that difficult. It took a long time to solve the
This ghost emoji expression is 4 bytes, MySQL uses UTF8 encoding,UTF8 accounts for 3 bytes, to store that emoji expression needs to change the MySQL encoding from UFT8 to UFT8 superset,UTF 8MB4;It is easy to change the database code to cause large-face garbled disaster. So when encountering emoji character expression, do special treatment. Online also have a lot
recently encountered a project, the customer's mobile phone sent on the expression to be displayed on the computer Web page, did not find a convenient way, so the following scenarios. as the emoji expression to the background is "mouth", how to find out the expression in the receiving data is the key, after various searches, I use the following regular expression matching to all the
In daily life, the user sends the content that contains the emoji expression, untreated, in the display is garbled. So this article introduces several processing methods of emoji expression involved in PHP development. We hope to help you.
Background
When you do development, you will find that storing nicknames is essential.
But this evil support
Background
When you do a micro-credit development, you will find that storing a micro-letter nickname is essential.
But this evil kind of micro-letter support emoji expression to do nickname, this is a bit of a pain in the egg
In general, the MySQL table is designed with the UTF8 character set. The nickname field with emoji is gone inside insert , and the enti
Emoji informationToday, the study of emoji, very interesting, a lot of information, abstract some information for everyone to share, but also a record of their own learning.Emoji IntroductionEmoji (maximum speed text, meaning from Japanese えもじ,e-moji,moji in Japanese is a character) is a set of 12x12 pixel emoticons originating in Japan, created by Chestnut Tanaka (Shigetaka kurit), which was first popular
㈠ PrefaceIn order to deal with the opportunities and challenges of wireless Internet, avoid the problems caused by emoji emoticons,The UTF8MB4 character set is recommended in advance for MySQL database recommendations involving wireless relatedThis has to be the key to a technology selection of the mobile internet industry㈡ restrictionsRequires >= MySQL 5.5.3 version, from the library must be 5.5, the lower version does not support this character set,
If there are comments or information recovery in the project place, often use emoji, sometimes such as the background does not support emoji, will show garbled error, we can turn emoji into Unicode encoding or UTF8 encoding format to the server. Of course, if the background
1. Filter the reason for emoji expressionIn our project development, emoji expression is a troublesome thing, even if we can store it, it doesn't have to be perfect, because it's updated fast: On platforms other than iOS, such as PC or Android. If you need to display emoji, you have to prepare a bunch of emoji images a
for free, and you can download it from GitHub:
Https://github.com/twitter/twemoji/releases
Unzip the directory after downloading, and then copy the upload 72x72 directory to your site. If you put it on the following path:/images/emoji/72x72/
Change Emoji expression Request address
Refer to any one of these options, select the corresponding access path, and then refer to the following steps.1. Log in to
Introduction to class libraries for processing Emoji based on PHP extension [Carmela] And emojicarmelaCarmela Introduction
Carmela provides a set of processing 4-4 UTF-8 solutions based on PHP, PHP extension, JAVA, C ++ and other languages, such as common Emoji label supportBackground:
UTF-8 format contains Emoji emojis string directly inserted into the database,
What is emoji? Let's take a look at the explanation of Baidu EncyclopediaEmoji is the expression symbol, from the Japanese word "text" (the pseudonym is "えもじ", the pronunciation is emoji).Emoji's creator, the Japanese, is Kurita (Shigetaka Kurita), who is looking at elements of his childhood for inspiration, such as Japanese comics and Japanese characters. "There are many different symbols in Japanese comic
Series Index
Unicode and Emoji
Dictionary tree Trietree and performance testing
Production Practice
Production Practice
We finally have to solve the Emoji in the browser and print on the same display.
In contrast, the MacOS and Unicode standards are similar in their display and accuracy, and ultimately decide to use a Unicode-provided image as a cross-platform display.
The browser and render
Label:Let MySQL support emoji expression access solutionThe app mobile does not need to make any changes, the service side modification can.First step: Modify Jdbcurl:Conn.url=jdbc:mysql://127.0.0.1:3306/eyes?zerodatetimebehavior=converttonullautoreconnect=trueStep two: MySQL driver package:Mysql-connector-java-5.1.24.jarStep Three: Database version check:Select version () #查看mysql版本
5.6.23-log supports UTF8MB4 character setFourth Step: Modify the My
Series Index
Unicode and Emoji
Dictionary tree Trietree and performance testing
Production Practice
Objective
It is common for users to modify the data themselves, and we stipulate that the nickname length is between 2 and 10. Suppose the user tries to use the emoji as the user name, is the request legal?
Open the browser console, enter ''.length , and print the result is 11.
Company project
Emoji, these small cartoon images that express emotion have become an integral part of modern communication, so that Emoji's word has been officially earned in 2015 by Webster's and Oxford's dictionaries. When it comes to the birth of emoji, here's a very interesting little story:Around 1999, a Japanese young man named Kurita Water rang, like many straight men, was often misunderstood for texting his girlfr
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
Php receives emoji expressions in ios and saves them to the database ????. Php receives emoji expressions in ios and saves them to the database ????. According to the Internet, the database code is changed to utf8mb4. the database version is 5.5.24. asking for advice, urgent, online, etc.
Reply to discussion (solution)
Into ???? Indicates that the encoding cannot be recognized and must be transcoded.If yo
Seemingly emoji processing should be with our iOS development has a great relationship, but in fact, for emoji processing as long as the server-side to do it, I said the processing is we put the expression to the server, then what needs to be done on the server side to deal with it?Server if directly stored we pass past the expression will be problematic, because the database does not support the storage ex
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.