how are smileys encoded in mysql utf-8 mb4 database?

廉价感情. 提交于 2021-01-28 11:01:03

问题


I changed my mysql database to utf-8 mb4, so that users could enter smileys from their mobile phones / mac. It works (users can enter smileys and those smileys are shown in the web app on supported devices), but whenever I have a look at the table contents (via terminal or mysql workbench) it shows each smiley as a single question mark. How exactly are those smileys saved? I assume they got a utf-8 mb4 code, but is there any way to look at those?

Thanks!


回答1:


I suspect Workbench is running in utf8 mode, not utf8mb4. Change that.

To further verify that the data is stored correctly, do a SELECT HEX(col) ... to see the actual bytes stored. For example: 😁 => F09F9881



来源:https://stackoverflow.com/questions/29318784/how-are-smileys-encoded-in-mysql-utf-8-mb4-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!