I cannot add Emoji

Hello,
When i add Emoji in message it cannot send and cannot store in archive message table.

Gives error like below:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect string value: ‘\xF0\x9F\x8E\xAF</…’ for column ‘stanza’ at row 1

Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect string value: ‘\xF0\x9F\x8F\xA1’ for column ‘body’ at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3971)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1548)
:frowning_face:

Hi Pratik,

I recently came across this issue and solved it by altering the database.

Alter your openfire database with below queries. This should solve your issue of emoticons.

ALTER TABLE ofMessageArchive MODIFY COLUMN body TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

ALTER TABLE ofMessageArchive MODIFY COLUMN stanza TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

ALTER TABLE ofOffline MODIFY COLUMN stanza TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Let me know if you still face the issue.

Regards,
Bipin