simone_s1994 simone_s1994 - 11 months ago 164
PHP Question

Android | PHP | MySql - Save emoji to Mysql server from Android

How can I send text with emoji from Android app to server and save it correctly in MySql database?

In Android app I've pass some parametres with post method to php server, then I save it in to MySql database. But I've 2 problems with emoji

Answer Source

You can use StringEscapeUtils Apache Library

For saving the unicodes in database you have to encode them. So send your unicodes to server by encoding like

StringEscapeUtils.escapeJava(/* string message*/)

For displaying the encoded unicode in android

StringEscapeUtils.unescapeJava(/* string message*/)