Legacy Knowledge Base
Published Sep. 10, 2025

Error "Incorrect string value" in logs when adding emojis to Web Content

Written By

Gustavo Vasconcelos

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How to articles!

While we make every effort to ensure this Knowledge Base is accurate,it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When inserting emojis (emoticons) to a Web Content article, the portal fails to add/update the article and an error similar to the one below is shown on logs.
09:33:30.544 ERROR [http-nio2-8080-exec-48][JDBCExceptionReporter:234] Incorrect string value: '\xF0\x9F\x98\x8D\xE2\x9D...' for column 'content' at row 1

Environment

  • Liferay DXP 7.x

Resolution

  • While Liferay DXP supports emoji, changes must be made to both the database and to the portal-ext.properties DB connection string. This article deals the procedure with MySQL only, but similar solutions are available to other RDBMS.
  • Create the database with the character set utf8mb4 instead of utf8 (which is an alias for utf8mb3). Example:
CREATE DATABASE `lportal` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  • Create the tables with the charset utf8mb4 instead of utf8 . Example:
CREATE TABLE `tablename` (
(...)
PRIMARY KEY (`primaryKey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;
  • If the database already exists, dump it with mysqldump and replace the parameters DEFAULT CHARSET=utf8; to DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci; for each CREATE TABLE query.
  • Change the property jdbc.default.url from portal-ext.properties replacing the parameter characterEncoding=UTF-8 to useUnicode=true.

Additional Information

  • LPS-43195: Exception occurred when input "emoji" as content on mobile device

 

Did this article resolve your issue ?

Legacy Knowledge Base