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
Original works, allow reprint, please be sure to use hyperlinks in the form of the original source of the article, author information and this statement. Otherwise, the legal liability will be investigated. http://suifu.blog.51cto.com/9167728/1847087The 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 UT
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 text height calculation in IOS has been a problem, and Apple has been modifying it. Over the past few days, I have read the boundingrectwithsize method.
- (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options context:(NSStringDrawingContext *)context NS_AVAILABLE_IOS(6_0);
After several pitfalls, I finally found a better method.
Http://stackoverflow.com/questions/13621084/boundingrectwithsize-for-nsattributedstring-returning-wrong-size
Notes for use:
1: Each p
An error is returned when the MySQL-emoji emoticons are stored.
Solution: Replace the character set utf8 --> utf8mb4
This article reposted an article published on the public platform.
A developer reported a problem last week: the front-end application crawls Weibo information. A few pieces of data cannot be inserted every day. Application log display: java. SQL. SQLException: Incorrect string value: '\ xF0 \ x9F \ x92 \ xAA ",... 'For column' raw
Ext.: http://www.cnblogs.com/lvyerose/p/4315894.html#3135760such as QQ, social chat, an integral part of our commonly used expression input, and sometimes interesting expression can also attract users to reach the user's permanent effect, of course, we do not have to study how to do the development of how to be interesting, how to do enough to attract users, We just need to make the required functionality perfectly achievable.Next we simply implement the expression input conversion on the Androi
can see that the client, connection, database, result, and server in the configuration are UTF8MB4. In fact, the completion of the 90%, as long as the verification of the know.Very good, no error, the next query, you can see if you can display the normalThis step is also correct!In this way, we have completed the configuration of the database, but it is also important to note that the current operation of the database, data tables, fields are also required to support the UTF8MB4# for each datab
The expression encoding and decoding problem that was encountered while doing the barrageEmoticons are generally encoded using Unicode encoding, followed by the encoded format
\ud83d\ude18\ud83d\ude18world\u4e16\u754chaha\ud83d\ude17 //CodingNSString *unistr =[NSString Stringwithutf8string:[_barragetext.text utf8string]; NSData*unidata =[Unistr datausingencoding:nsnonlossyasciistringencoding]; NSString*goodstr =[[NSString alloc] Initwithdata:unidata encoding:nsutf8stringencoding]; NSLog (@
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.