简体   繁体   中英

Emojis from MySQL database showing up as '?'

In my Phorum database I have changed the collation to utf8mb4_general_ci and successfully got emojis stored in the message body, however when you try to load the message it just displays a single '?'

Could this be an issue with the character set in use? I've found this:

// The charset to use for displaying special characters.
$PHORUM["DATA"]['CHARSET']="UTF-8";

According to this page: mathiasbynens.be , "MySQL's utf8 charset only partially implements proper UTF-8 encoding. It can only store UTF-8-encoded symbols that consist of one to three bytes; encoded symbols that take up four bytes aren't supported."

To execute this sql in mysql: ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM