(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 key point of technology selection in the mobile Internet industry.
(Ii) Restrictions
Required> = MySQL 5.5.3 and slave database must also be 5.5. Earlier versions do not support this character set o
How does PHP handle the emoji characters submitted by mobile?
Now the mobile side provides a lot of expressions, such as Baidu Input method in the expression.
A lot of expressions in PHP, after it is not recognized content, when stored in MySQL, it will start from the expression position, the contents of the back will be lost.
such as user input: Start content [Emoticons] End content
Get it in PHP and save it in MySQL only: start content [
Is th
(Val);}Export function Unicodetoarray (val) {Return Val.match (reunicode) | | [];}Export function Asciitoarray (val) {Return Val.split (");}Yes, a lot of regular. It's a headache to watch. This method can be satisfied, the expression is transferred to a portion of the group. In this case, we can only use the judgment array.Then according to the resulting array, go to each one to determine the length of each; The code is as follows:Let Strarr = Utils.toarray (val);Let str = ", strlen = 0, num =
(collate) is not the same, so you need to specify the rules of comparison, utf8mb4_unicode_ci is utf8mb4 the character set corresponding to the comparison rules. For example, if the character set is a utf8mb4 database, execute the SQL statement: select * from boy where name=‘xueweihan‘ you need to filter the records in the database with the specified collate rules.Use PostureTo create a database:CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;To connect to a database
No details: MySQLALTERDATABASEmy_databaseDEFAULTCHARACTERSETutf8mb4COLLATEutf8mb4_general_ci; ALTERTABLEmy_tableCONVERTTOCHARACTERSETutf8mb4COLLATEutf8mb4_general_ci;
No details about MySQL alter database my_database default character set utf8mb4
Now the mobile side provides a lot of expressions, such as Baidu Input method in the expression.
A lot of expressions in PHP, after it is not recognized content, when stored in MySQL, it will start from the expression position, the contents of the
After the internet has said that the Unicode expression needs mysql5.5.3, my version is MySQL 5.5.38 so is supported, only need to follow the following configuration
Then you can restart the
[Client]default-character-set =
To find a regular expression, replace a regular emoticon with an emoticon (emoticon)
To find a regular expression, replace a regular emoticon with an emoticon (emoticon)
[Happy] to be replaced by (the Chinese name of the picture is not regulated?)
First, download Androidemoji.ttf fonts
Address 1:github Android Platform
Address 2:androidemoji.ttf.zip
Second, the use
2.1 Copy the font to the Assets/fonts directory
2.2 Code calls
try {
typeface typeface = Typeface.createfromasset
Usage Scenario: PHP as the server-side receive app interface data, due to MySQL format problem caused by no way to directly save emoticons package
The solution is to convert the expression to Base64 can be seen in the format, due to the length of
Usage Scenario: PHP as the server-side receive app interface data, due to MySQL format problem caused by no way to directly save emoticons package
The solution is to convert the expression to Base64 can be seen in the format, due to the length of
Off-topic (can skip)
I believe this article has let everyone wait too long, not my trick, hang everyone's appetite, but write an article really need to spend too much time. Perhaps an article, you spend 3-5 minutes to read, school will master, and I will spend 2-3 hours of time to complete, perhaps only attentively wrote the article the person can understand, hope we can mutual understanding!
Someone once said to me, I write things too elementary, are entry-level things. Well, I admit that tun
Article 3 of the public account development tutorial-sending of symbolic expressions (I ). I believe that this article has made everyone wait for too long. it does not mean that it takes too much time to write an article. Maybe an external question (you can skip it)
I believe this article has made everyone wait for too long. it takes too much time to write an article instead of being confused and appetizing. Maybe it takes 3-5 minutes for you to finish reading an article and learn how to master
Digress (skipped)
I believe this article has made everyone wait for too long. It takes too much time to write an article instead of being confused and appetizing. Maybe it takes 3-5 minutes for you to finish reading an article and learn how to master it, but it takes 2-3 hours for me to complete it, maybe only those who have carefully written articles can understand it and hope everyone can understand each other!
Some people once told me that what I write is too basic and is an entry level. Wel
blockbuster ..... The test came, and there was a bug.Convex-^ ConvexThere's a bug? (In many cases, we are not fully guided by the thought, and some scenarios are not predictable, so experience is critical)The above code, in the input, the English can be normal restrictions and processing, but if the input characters with emoji emoji, and the user is using the Paste method is likely to be a bug. Look, put a
1. Filter the reason for emoji expression In 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
Topic Links:http://acm.hdu.edu.cn/showproblem.php?pid=5882problem DescriptionRock-paper-scissors is a zero-sum hand game usually played between both people, in which each player simultaneously forms O NE of three shapes with an outstretched hand. These shapes are "rock", "paper", and "scissors". The game has only three possible outcomes other than a tie:a player who decides to play Rock would beat another player who Had chosen scissors ("Rock crushes scissors") but would lose to one who had play
SpockProxy is an open-source project generated by a real project (Spock is a Rails application, and SpeckProxy should be used outside Rails, such as PHP or. is a branch of MySQLProxy and supports range-basedhorizontalparitioning. His improvements to MySQLProxy include: ). do not
Spock Proxy is an open-source project generated by a real project (Spock is a Rails
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.