I'm trying to support emoji on Openshift MySql cartridge. I've set the UTF8mb4 character set following a few guides, but it doesn't seem to work. When i try to INSERT an emoji in a VARCHAR field, it instead stores "????". Is this an Openshift problem? Does anybody know how to fully support emoji?
Asked
Active
Viewed 162 times
1 Answers
0
Multiple question marks usually means that the table/column is declared CHARACTER SET latin1
. See SHOW CREATE TABLE
to check.
That is only one of 4 places that you need to specify utf8mb4:
- Presumably the Emoji bytes are utf8 already.
SET NAMES utf8mb4
-- or whatever the equivalent in openshift/cartridge is for establishing the connection.- The table/column must be
CHARACTER SET utf8mb4
. - Html needs
<meta ... charset=UTF-8>

Rick James
- 135,179
- 13
- 127
- 222
-
Thanks Rick James. I've always had UTF8mb4 in tables and columns, and set the NAMES correctly...I don't know why Openshift MySql doesn't seem to accept utf8mb4! – MirkoM Mar 24 '16 at 14:59
-