Mobile input allows input expression, the expression is actually UTF-16 encoding, in the database storage will be lost, currently if the database Loadline code modified to UTF8MB4 can also be saved.If you do not want to modify the others, you can convert these emoji to the HTML character entity save.The code is as follows:Functionutf16_to_entities () { $content =mb_convert_encoding ($content, ' utf-16 '); $bin =bin2hex ($content); $arr = str_split ($
Reason:The UTF-8 encoding can be two, three, and four bytes. The emoji expression is 4 bytes, while MySQL UTF8 encodes up to 3 bytes, so data cannot be plugged in.Workaround:Convert MySQL encoding from UTF8 to UTF8MB4Steps:1. Modify the MySQL configuration file My.inidefault-character-Set=utf8mb4character-set-SERVER=UTF8MB42. Join[Client]port=3306default-character-Set=Utf8mb4[mysqld] Add character -Set-client-handshake= falsecollation-server= utf8mb4_
But we can replace it with a regular:
Copy the Code code as follows:
function Dhtmlspecialchars ($string) {if (Is_array ($string)) {foreach ($string as $key = = $val) {$string [$key] = Dhtmlspecialchars ($val);}} else {$string = Preg_replace ('/ (# (\d{3,5}|x[a-fa-f0-9]{4}) |[ a-za-z][a-z0-9]{2,5});)/', ' \\1 ',Str_replace (Array (' ', ' ' ', ' }return $string;}?>
The above describes the special emoji encyclopedia PHP special character process
: This article mainly introduces how to remove emoji. For more information about PHP tutorials, see.
public static function removeEmoji($text) { $clean_text = ""; // Match Emoticons $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; $clean_text = preg_replace($regexEmoticons, '', $text); // Match Miscellaneous Symbols and Pictographs $regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u'; $clean_text = preg_replace($regexSymbols, '', $clean_text);
Today, I made a function to get fans. I found that inserting nicknames into the database should have enough Incorrectstringvalue: 39; xF0x9Fx98x84xF0x9F find the point of information found that UTF-8 encoding may be two, three, four bytes. Today, Emoji provides a function for getting fans and finds that an error is returned when inserting nicknames into the database. the length must be enough.
Incorrect string value: '\ xF0 \ x9F \ x98 \ x84 \ xF0
Problem: Under Android platform, tedit input Emoji text, cannot display color (All Black), even if Edit.controltype = Platform is set as platform native control, still useless (real machine test Style and Platform is the same, and IOS platforms are different).Correction Method:Please make the source FMX. TextLayout.GPU.pas Copy to your project directory and make changes.procedureTtextlayoutng.dodrawlayout (ConstAcanvas:tcanvas); var... A little ...{++
Recently, there is a need for the project on hand is the input box can not enter the expression, and then on the various online looking for information, many people on the Internet program is:str = str.replace (/\ud83c[\udf00-\udfff]|\ud83d[\udc00-\ude4f]/g, "");The usage is probably:= "This.value = Value.replace (/\ud83c[\udf00-\udfff]|\ud83d[\udc00-\ude4f]/g," ")">;This is useful for sogou input method, but I changed the phone on the message fly input method tried, and no eggs, third-party ca
A week after the launch of the OS X 10.10.3 Beta, Apple launched the OS X Yosemite 10.10.3 beta3 for developers early this morning, one months apart from the first OS X 10.10.3 beta release. The release of the Beta 3 compiler is 14d98g, developers can be completed through the Mac App Store update or download in the MAC Developer Center!
OS X 10.10.3 Beta3 compiled with 14d98g, developers can complete updates via the Mac App Store or download them at the Mac Developer Center. In addition,
customer's personality. At present many websites are doing so, after all efficiency is the key, you this expression even if save, also perhaps where again use, show not.It is suggested that the tool method is convenient, practical and feasible.
/**
* Emoji expression Replacement
* *
@param Source Original String
* @param slipstr emoji expression replaced by the string
Tags: val with sql Hiberna https solve problem direct names nal Spring-boot JPA MySQL UTF8MB4 Emoji Write failed MySQL database,table,column default to Utf8mb4 caused By:java.sql.SQLException:Incorrect string value: ' \xf0\x9f\x98\xad ' for column ' title ' at row 1At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:965)At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3973)At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3909)
Tags: LTE RAC efault kanji MySQL server error code POSWhen the crawler inserted data into MySQL, it found an error "" "Incorrect String Value: ' \xf0\x9f" ", the problem is because UTF-8 can be two, three, four bytes, emoji expression or some special character is 4 bytes, So the content crawled from the Web page may contain emoticons, while MySQL's UTF8 encoding is up to 3 bytes, so data cannot be plugged in. The solution is as follows:Find my.cnf und
Data removed from the network can not be inserted into the database after parsing, prompting a field problem, the problem is as follows:Sqlexception:incorrect string value: ' \xf0\x9f\x98\x84 ' for column ' Wei_content ' at row 1After reviewing the data, it was found that the emoji character and database were different and could not be stored directlySolution One:Remove the emoji characters from the content
Let MySQL support emoji emoticons, involving wireless-related MySQL database recommendations are in advance with the UTF8MB4 character set.What's the difference between utf8mb4 and UTF8? The original MySQL UTF8 a character up to 3 bytes, while the UTF8MB4 expands to a character up to 4 bytes, so it can support more character sets.Solution: Convert the MySQL encoding from UTF8 to UTF8MB4.Requires >= MySQL 5.5.3 version, from the library must be 5.5, th
Tags: mysql utf8mb4 emojiThe company has new requirements, iOS client to go online comments can use emoji expression function, before MySQL 5.5, UTF-8 encoding only support 1-3 bytes, starting from MySQL 5.5, can support 4 byte UTF encoding utf8mb4, A character can support more character sets and can support more emoji. UTF8MB4 is compatible with UTF8 and can represent more characters than UTF8, which is a
Tags: group mysql set COM has a storage style NIC whyBefore the solution, you have to explain why there is an error, emoji expression occupies 4 bytes, but MySQL database UTF-8 encoding can only store 3 bytes, it will cause storage not to go inHow to troubleshoot emoji storage issuesMySQL UTF8 encodes a character up to 3 bytes, but a emoji expression is 4 bytes,
Emoji emoji characters are now widely supported in the app. But MySQL's UTF8 encoding support for emoji characters is not that good. So we often encounter such an exception:Incorrect string value: ' \xf0\x90\x8d\x83 ... ' for columnThe reason is that UTF8 encoding in MySQL can only support up to 3 bytes, while emoji
The solution of the emoji expression box in ios5.1 is that the emoji expression cannot work properly on some ios5.1 devices.
Display . Me
Test Ios5.1 (9b176
IPhone 4) the emoji cannot be displayed normally, all of which are boxes.
Ios5.1 (9b179 for iPhone 4S) can display emoji normally.
The reason is that
Emoji is the emoji, in the mobile phone is already very popular use of an expression.
Facing the problem:
Insert emoji expression, save to database times wrong:
Sqlexception:incorrect string value: ' \xf0\x9f\x98\x84 ' for column ' review ' at row 1
The UTF-8 encoding can be two, three, and four bytes. The emoji
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 server receives the time can be well judged to identify the best, our side backstage is su
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.