I have a few forms that I need to be able to save emojis, and the emojis can be anywhere on a string.
I can't seem to get unicode sequences to display as emojis.
Currently, the forms call a javascript function that call a PHP page via ajax and there it's inserted in the database. I need to be able to insert it into the database as \🙈
or \🙈
instead of \ud83d\ude48
.
The page meta is using charset=utf-8. The relevant columns in the database are using Character set utf8mb4 and Collation utf8mb4_unicode_ci.
\uXXXX
escapes are only valid in JSON, and&#XXXX;
entities are only valid in HTML or XML documents. Decode it properly to UTF-8, store it properly as UTF-8, and re-encode if necessary for a particular output method. stackoverflow.com/questions/279170/utf-8-all-the-way-through