Skip to content

fix: add --default-character-set=utf8mb4 to mysql calls in initialize…#117

Open
Friesen-Automation wants to merge 2 commits into
Dolibarr:mainfrom
Friesen-Automation:Friesen-Automation-patch-1
Open

fix: add --default-character-set=utf8mb4 to mysql calls in initialize…#117
Friesen-Automation wants to merge 2 commits into
Dolibarr:mainfrom
Friesen-Automation:Friesen-Automation-patch-1

Conversation

@Friesen-Automation

Copy link
Copy Markdown

…Database()

Fixes #115

Problem:
During auto-installation (DOLI_INSTALL_AUTO=1), the mysql client connects without an explicit character set. This causes the client to default to latin1, while the SQL data files are UTF-8 encoded.

As a result, multi-byte UTF-8 characters (e.g. German umlauts ä, ö, ü, French accents é, è, ç, and other non-ASCII characters) are double-encoded and stored incorrectly in the database.

Example: "Württemberg" is stored as "Württemberg"

Fix:
Added --default-character-set=utf8mb4 to all mysql import calls inside initializeDatabase(). This ensures the client correctly interprets the UTF-8 encoded SQL files during the initial database setup.

Affected languages: all languages using non-ASCII characters (German, French, Spanish, etc.)

Tested with: MariaDB 10.11, Dolibarr latest

Friesen-Automation and others added 2 commits June 9, 2026 10:14
…Database()

Fixes Dolibarr#115

Problem:
During auto-installation (DOLI_INSTALL_AUTO=1), the mysql client connects without an explicit character set. This causes the client to default to latin1, while the SQL data files are UTF-8 encoded.

As a result, multi-byte UTF-8 characters (e.g. German umlauts ä, ö, ü,  French accents é, è, ç, and other non-ASCII characters) are double-encoded  and stored incorrectly in the database.

Example: "Württemberg" is stored as "Württemberg"
 
Fix:
Added --default-character-set=utf8mb4 to all mysql import calls inside  initializeDatabase(). This ensures the client correctly interprets the UTF-8 encoded SQL files during the initial database setup.

Affected languages: all languages using non-ASCII characters (German,  French, Spanish, etc.)

Tested with: MariaDB 10.11, Dolibarr latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong encoding on newly created database: README needs an update

2 participants