I'm making a blog.

I have a wheelform comments input type that needs to be stored as utf8mb4 in the local database.

My MySQL database version 5.6 is configured to utf8mb4 in the database, tables, and columns.

Every time I send an emoji to the database it is stored as four question marks ????.

Is there a way to save emojis correctly in the database? Perhaps using encodeMb4(), but I don't know where and how to apply it.

  • Are you sure all of the textual columns in the database are using utf8mb4 character set? What is a "wheelform comments input type"? Is that a custom field type coming from a Craft plugin? – Brad Bell Apr 11 '19 at 2:41
  • Hello @Brad! Yes wheel form is a plugin that gives you form creation in craft 3. And another yes, my database and database server set are in utf8mb4 and the table and column that i need to store emojis are in utf8mb4 also. I check it with show variables mysql query. – André Castro Apr 11 '19 at 7:58
  • Hrm... never used the plugin before, but maybe they're doing something that's interfering. StringHelper::encodeMb4() should only be needed for non-utf8mb4 char sets. Maybe open an issue with them to see if they can look into it further? github.com/xpertbot/craft-wheelform/issues – Brad Bell Apr 11 '19 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.