Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Dolibarr
  3. Dolibarr package forces a utf8mb3 DB connection → 4-byte chars (emoji) rejected on write

Dolibarr package forces a utf8mb3 DB connection → 4-byte chars (emoji) rejected on write

Scheduled Pinned Locked Moved Dolibarr
1 Posts 1 Posters 9 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BenjaminJ
    wrote last edited by
    #1

    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!

    1 Reply Last reply
    1

    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
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Bookmarks
    • Search