In app applications, it is very common to include emotices in text. Therefore, when processing emotices in the background, I have encountered the following two problems:
1. Storage of emotices in mysql.
The utf8 encoding of emotices sometimes has 4 bytes, so the general utf Encoding cannot be stored. I can see a common solution on the Internet, upgrade mysql to mysql 5.5, and change the character encoding to utf8mb4_general_ci. However, in practice, I found another method, applicable to mysql 5.1, that is, to change the type of the field containing the emoticon to blob. Yes, it is stored in binary.
2. Processing of emoticon in text
Most of the time, if there are emotices in the text, the processing of these texts will be problematic. For example, if a user's nickname has an emoticon, how can I convert this nickname to PinYin? In actual development, I encountered this problem. First, I found zookeeper plugin (the default value is "#").
[Author] Zeng jiansheng
[Author email] h6k65@126.com
[Author QQ] 190678908
[Sina Weibo] @ newjueqi
[Blog] http://blog.csdn.net/newjueqi
Http://blog.sina.com.cn/h6k65