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 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
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
MySQLutf8mb4 character set: supports emoji emojis bitsCN.com
MySQL utf8mb4 character set: supports emoji
(I) Preface
In order to cope with opportunities and challenges of the wireless Internet, and to avoid problems caused by emoji,
We recommend that you use the utf8mb4 character set in advance for MySQL databases involving wireless connection.
This must be a
In theory, Android can display all Unicode characters, display all Chinese characters (currently there are more than 80,000 East Asian characters in Unicode), emoji of course, no problem.Chinese characters with Unicode values below 0xFFFF have long been widely supported, so this article does not treat them as uncommon characters. There are more than 20,000 simplified and traditional Chinese characters .The uncommon word in this paper refers to Chinese
This is a magical site: Http://www.xn--vi8hiv.ws/?utm_source=mindstore.io (copy and paste into emoji URL builder)
Open enter "web address link" in the input box
Then click on the Generate Emoji emoticon button below.
Then you can see that the address has been converted to emoji emoticons address. Replication can be published to various social applications
Tags: rect GPO byte my.ini height technology share font server mysqldStumbled across this problem and recorded that issues related to coding and database character sets have been cumbersome.?? This emoji character reported an error in the repository: incorrect string value: ' \xf0\x9f\x91\x8d 2 ... ' for column ' Mark ' at row 1The solution is as follows:utf-8 encoding can be two, three, four bytes, emoji e
Ordinary string or expression is a placeholder 3 bytes, so utf8 enough, but the mobile side of the emoji placeholder is 4 bytes, the ordinary utf8 is not enough, in order to deal with the wireless internet opportunities and challenges, to avoid the problem of emoji emoticons, involving wireless-related MySQL Database recommendations are in advance using the UTF8MB4 character set, which must be a key element
Tags: style blog http color io using AR java forPhone end insert emoji expression, save to database times wrong: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 (Mysqlio.java:4028) at Com.mysql.jdbc.MysqlIO.sendCommand (Mysql
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.