Incorrect string value for column `xwiki`.`xwikircs`.`XWR_PATCH` at row 1

  • XWiki 17.3.0
  • Tomcat 11.0.7 (OpenJDK 21.0.2)
  • MariaDB 11.4.5
  • MariaDB Connector/J 3.5.3

I am receiving an error when saving an XWiki page containing :wink:

ERROR o.h.e.j.s.SqlExceptionHelper - (conn=146) Incorrect string value: '\xF0\x9F\x98\x89)....' for column `xwiki`.`xwikircs`.`XWR_PATCH` at row 1

I saw there was a similar thread in the past related to UTF-8 and a regression in MySQL connector between 8.0.29 - 8.0.32, but as you see I’m using MariaDB Connector/J 3.5.3 (latest stable).

I tried the -Dfile.encoding=utf-8 workaround mentioned in the previous thread, but no luck.

Did anyone encounter a similar problem or have any ideas what else to try in this case?

Hello, unfortunately I’m not using personal XWiki with MariaDB, on my end it’s PostgreSQL - just tested and I don’t have any issues with saving emojis on page content (XWiki 17.4, Tomcat 10.1.34 and PostgreSQL 17.2).

Note that for MariaDB XWiki expects the database to use utf8 or utf8mb4 encoding with collation *_bin and it’s highly recommended to use utf8mb4 (and utf8mb4_bin).

In any case, as you looked at previous cases (i.e MySQL) and you have detailed steps and information (which does not contain personal or confidential information), you can report this issue on Jira project.

Interesting … so apparently we had utf8mb3 / utf8mb3_general_ci for some reason (I presume this is what the installer does by default - maybe).

I’ve gone through and changed all tables and columns to utf8mb4 / utf8mb4_bin as noted (except for those with foreign key constraints, which MariaDB make it harder to fix now), and now I can save pages containing :wink: without any errors.

So, no bug report from me. I can’t be sure if this was an installation screw-up at our side or not - but either way, I seem to have a fix.

Hope it helps someone else facing the same drama in future.

1 Like