Label:Get user nickname nickname with emoji expression, converted to character code is this form "\xf0\x9f\x91\x8d\xe6\x94 ...", The following error may occur with direct save caused By:java.sql.SQLException:Incorrect string value: ' \xf0\x9f\x98\x84 ' forColumn ' Review ' at row 1At com.mysql.jdbc.SQLError.createSQLException (Sqlerror.java:1074) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (Mysqlio.java:4096) at Com.mysql.jdbc.MysqlIO.checkErrorPacket
Domain stores the Emoji property type setting bit byte[]
Class Usertest { byte[] namebytes//Store emoji emoticon field date dateCreated //grails time Magic field insert automatically gets current system time date lastupdated //grails time Magic field update automatically gets current system modification time static constraints = { } // Custom get, Set method conversion byte[] a
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
This is a created
article in which the information may have evolved or changed.
package util import ( "regexp" "strconv" "strings") //表情解码func UnicodeEmojiDecode(s string) string { //emoji表情的数据表达式 re := regexp.MustCompile("\\[[\\\\u0-9a-zA-Z]+\\]") //提取emoji数据表达式 reg := regexp.MustCompile("\\[\\\\u|]") src := re.FindAllString(s, -1) for i := 0; i
I write this thing to find N expression selector, all use jquery, mobile is not suitable, because jquery with min all have to 90k. And does not need the expression to turn the text or the text to the expression this function.This article uses the div input box, and selects the expression to insert a piece of HTML directly into the text content (emoji is the SVG format), the effect is visible.On the CodeHtmlname= "Note" class= "Newpost" ID= "Emojiinp
I exported the data with emoji expression to excel in the Phpexcel library, Apple Mac OSX output could not be opened, winddows can open, but the data after the expression is lost. Is there any good solution to this?
Reply content:
I exported the data with emoji expression to excel in the Phpexcel library, Apple Mac OSX output could not be opened, winddows can open, but the data after the expression is
Call this methodfunction Findsurrogatepair (point) { // assumes point > 0xFFFF var offset = Point -0x10000, = 0xd800 + (offset >>), = 0xdc00 + (offset 0x3ff); return [Lead.tostring (+), trail.tostring (+)];}Example: The Unicode encoding of a emoji is u+1f339, the previous u+ is replaced with 0x, that is, u+1f339-->0x1f339, to the above functionFindsurrogatepair (0x1f600)You will then receive an arrayThe two items in the array are stitc
A emoji expression on a Mac.
Method One: Using shortcut keys
This is the fastest way, shortcut keys are control+command+ space bar, as shown in the following figure, you can quickly open the expression Input board, double-click the relevant emoticons can be inserted.
Method Two: With the help of the Edit menu
The first step, here in the text document as an example, need to enter emoji emoticons,
A emoji expression on a Mac.
Method One: Using shortcut keys
This is the fastest way, shortcut keys are control+command+ space bar, as shown in the following figure, you can quickly open the expression Input board, double-click the relevant emoticons can be inserted.
Method Two: With the help of the Edit menu
The first step, here in the text document as an example, need to enter emoji emoticons, cl
MySQL store emoji emoticons to use the UTF8MB4 character set, which is 4 bytes of storage, the minimum supported version is 5.5.3+, if not, upgrade to a newer version.Modify the MySQL configuration fileWindow directory: mysql/my.iniubuntu16.04 directory:/ETC/MYSQL/CONF.D/MYSQL.CNF configuration client/etc/mysql/mysql.conf.d/mysql.cnf Configure server Other directories: generally in ETC/MYSQL/MY.CNFAdd the following three parts to the MySQL configurati
Let MySQL support emoji expression solution: convert MySQL encoding from UTF8 to UTF8MB4. Requires >= MySQL 5.5.3 version, (can also be detected 5.5.29) Low version does not support this character set, copy error stop MySQL Server serviceModify MY.CNF or Mysql.ini[Client]Default-character-set = Utf8mb4[MySQL]Default-character-set = Utf8mb4[Mysqld]Character-set-client-handshake = FALSECharacter-set-server = Utf8mb4Collation-server = Utf8mb4_unicode_cii
1. Cause of Error:The MySQL utf-8 code stores 2-3 bytes, while emoji is 4 bytes.2. Workaround:Modify the MySQL configuration file, under Windows for My.ini (Linux for my.cnf), the same content is modified.[Client]default-character-set = Utf8mb4[mysql]default-character-set = Utf8mb4[mysqld]character-set-server = Utf8mb4collation-server = Utf8mb4_unicode_ci3. Change the corresponding field in the database to Utf8mb4_general_ci4. In my project, configure
Label:Java get to the end of the delivery of emoji expression inserted after MySQL error message, errors are as follows Java.sql.SQLException:Incorrect string value: ' \xf0\x9f\x92\x94 ' for column ' name ' at row 1 at
com.mysql.jdbc.SQLErRor.createsqlexception (sqlerror.java:1073) at
Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3593) At
Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3525) at
Com.mysql.jdbc.MysqlIO.sendCommand (mysqlio
Since the version of the database is now 5.5.2 , but to look at the Internet to directly store emoji emoticons, you need to upgrade to 5.5.3 and then set the CharSet utf8mb4 , but the upgrade database feels sensitive operation.Consider how long after the direct consideration of using regular to replace, but emoji the expression of the code unicode too much, in the Internet to find a code, or 2 years ago upd
Series Index
Unicode and Emoji
Dictionary tree Trietree and performance testing
Production Practice
After the knowledge of Unicode and Emoji is prepared, this article enters the coding link.
When we know that Emoji is a sequence of Unicode characters, it is natural to understand that Emoji find and sens
Emoji expression is really omnipotent. You know it can be a password, but do you think it can be programmed? Foreign forum 4Chan A netizen has turned emoji into a programming language.This language is called Fourman, it certainly has an expression name, but I am sorry, I am using the edit box is not out Ah! Take a look at the example in the graph, can you guess what you wrote? It's probably programmed to be
background
mobile devices often occur when users send content that contains emoji emoticons, unprocessed, and garbled when displayed.
Solution Solutions
1. Database support: Convert MySQL encoding from UTF8 to UTF8MB4.
2. Match emoji expression in content to filter or replace
/** * Expression Conversion update to ios9.2 covers encoding range * @param $str * @return mixed */public static function emoji_to_h
This article mainly introduces how to enable MySQL to store emoji characters. The key is utf8mb4 character set settings. For more information, see MySQL to support emoji versions later than 5.5.3, the character set must be 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
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.