Hi,
On our Dolibarr install (Cloudron, MySQL addon), creating a ticket (or any record) that contains a 4-byte character (e.g. an emoji
) fails with:
Incorrect string value: '\xF0\x9F\x98\x8A...' for column 'message'
Root cause: the database and all schema tables are already utf8mb4 (the Cloudron MySQL addon defaults to utf8mb4). The only utf8mb3 link in the chain is the connection charset, which the package hardcodes in /app/pkg/cloudron.conf.php:
$dolibarr_main_db_character_set = 'utf8'; // = utf8mb3, 3 bytes max
$dolibarr_main_db_collation = 'utf8_unicode_ci';
So Dolibarr issues SET NAMES utf8, and MySQL rejects any 4-byte character on write.
Because cloudron.conf.php is included after /app/data/conf/conf.php (and is read-only), users cannot override the charset persistently — any change in /app/data/conf/conf.php gets overwritten.
Suggested fix — set in cloudron.conf.php:
$dolibarr_main_db_character_set = 'utf8mb4';
$dolibarr_main_db_collation = 'utf8mb4_unicode_ci';
(Ideally also guard it so /app/data/conf/conf.php can override.) Existing installs already have utf8mb4 tables, so this only aligns the connection — no data migration needed.
Thanks!