Answer the question
In order to leave comments, you need to log in
Emoji work with unicode in html, php and mysql?
Good afternoon, tell me how to work with unicode emoji?
The problem lies with the icons of flags and others.
For normal processing of emoji in MySQL: устанавливаем кодировку utf8mb4
In html I write them as: &#x ffff; (без пробелов)
in PHP, as I understand it, there should be no problems?
the essence of the question:
How to specify Emoji (country flags), which are set by 2 values?U+1F1E6 U+1F1FC
Answer the question
In order to leave comments, you need to log in
https://unicode-table.com/ru/1F1E6/
https://unicode-table.com/ru/1F1FC/
Accordingly, we get in UTF-8 F0 9F 87 A6 F0 9F 87 BC
Either a string "\xF0\x9F\x87\xA6\xF0\x9F\x87\xBC"
Or HTML codes 🇦🇼
It is better for PHP to convert the string to unicode before writing to the database, and to convert it back when requesting from the database. I used this library on a project and it worked great.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question