问题
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