0

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?

MirkoM
  • 1
  • Welcome to Stackoverflow! Can you please elaborate your question having your effort like code or something so that people could get your problem early and help you? Thanks! – Enamul Hassan Apr 09 '16 at 11:40

1 Answers1

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
  • Grrr... Another 3rd party software getting in the way. – Rick James Mar 25 '16 at 01:26