android and ios client call a interface with emoji character,but mysql database encoding is utf8 (motify to utf8mb4 is not allowed). How to filter emoji character ? I want to use unicode Regex,i think is not perfect. I has read some java code like this link http://www.cocoachina.com/ios/20160527/16494.html ,but not yet achieving the desired results,has better tools or idea to fix it?
Asked
Active
Viewed 466 times
0
-
Instead of getting rid of emojis, how about url encode the string? – Ricky Mo Dec 06 '18 at 08:47
-
utf8 is format for serialization of Unicode text. It should handle all Unicode symbols. You may want to check which version of Unicode is supported in your DB. – talex Dec 06 '18 at 08:47
-
2Possible duplicate of [Android - How to filter emoji (emoticons) from a string?](https://stackoverflow.com/questions/22178349/android-how-to-filter-emoji-emoticons-from-a-string) – hnefatl Dec 06 '18 at 08:48
-
it not database problem,the program is online. UTF-8Unicode maxlen is 3,insert to databse shows 'Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x84' for column ' – YuJia Dec 06 '18 at 08:57
-
thanks,@hnefatl. what about ios? – YuJia Dec 06 '18 at 08:59
-
@YuJia The idea behind the top answer in that post is language-agnostic. The implementation is given in Java, but it won't be hard to implement in whichever language you're using for your iOS app. – hnefatl Dec 06 '18 at 09:14