Dolibarr package forces a utf8mb3 DB connection → 4-byte chars (emoji) rejected on write
-
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 onlyutf8mb3link 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.phpisincluded after/app/data/conf/conf.php(and is read-only), users cannot override the charset persistently — any change in/app/data/conf/conf.phpgets 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.phpcan override.) Existing installs already have utf8mb4 tables, so this only aligns the connection — no data migration needed.Thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login