Emoji's not working in offline chat when using Openfire to chat between two iOS devices (using a MySQL db)

Hi everyone,

I have a problem with Openfire and especially support for emoji characters. I’ve searched on internet found out that in order to support emoji, I have to change the encoding and collation of the database and tables to UTF-8 unicode (utf8mb4). I’ve done that using the following SQL commands:

SET NAMES utf8mb4;
ALTER DATABASE openfire CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
ALTER TABLE ofOffline CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

So in the statements above, I’m changing the character set and collation of the database and table. Next, I read that I should change the JDBC driver to support unicode. I have the following value for the “database.defaultProvider.serverURL” entry in my system properties (using the Openfire admin webpage):

jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&useUnicode=tr ue&characterEncoding=UTF-8&characterSetResults=UTF-8

When I’m sending messages with emoji between two online users, it works flawless. When the recipient of the message is offline, the message is stored to the database and this is where it goes wrong: the emoji is not correctly stored in the database (it is stored as two question marks).

I’m not sure what I can try now or whether there are any other workarounds for this issue. Any help would be greatly appreciated.

Thanks in advance!