View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Support full unicode in MySQL databases - ProjeQtOr

Prochaines Sessions

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)
 

13 mai 2025 (10h30-12h)

5 juin 2025 (16h-17h30)

 
 

Planifiez avec ProjeQtOr

14 et 15 mai 2025 (9h-12h30)

18 et 19 juin 2025 (9h-12h30)

 
 

Administrez avec ProjeQtOr

20 et 21 mai (9h-12h30)

25 et 26 juin (9h-12h30)

 

 

 

Support full unicode in MySQL databases

More
19 Déc 2016 13:00 - 19 Déc 2016 13:03 #1 by papjul
Hi,

I suggest that MySQL databases should be created with collation utf8mb4_unicode_ci instead of utf8_general_ci.
First, why utf8mb4 instead of utf8?
- utf8 can lead to data loss (truncated data)
- utf8 can lead to critical security issues (see more in the link at the bottom)
- it supports all of Unicode which is required in a worldwide project such as ProjeQtOr to fully support asian languages for example, and also emojis

Then, why _unicode_ci over _general_ci?
- _unicode_ci is better at sorting (you will see almost no differences in languages such as English or French but this should be helpful in other languages, such as German).
- _general_ci has however slightly better performances

What can be done?
1. Make new ProjeQtOr installations utf8mb4 by default if MySQL is selected and MySQL/MariaDB version >= 5.5.3 (released more than 6 years ago). In prerequisities, you can still require MySQL v5+ but you should recommand v5.5.3 or higher.
2. utf8mb4 is backwards compatible with utf8 so existing databases can be migrated if MySQL/MariaDB version >= 5.5.3 (released more than 6 years ago) B) Edit: Ask the administrator to make a full backup before this step.
When MySQL database is in utf8mb4, connect with SET NAMES 'utf8mb4';

You can complete your reading with mathiasbynens.be/notes/mysql-utf8mb4
It explains why you should use utf8mb4 and how to migrate.

I hope I convinced you,
Thanks for reading,
Last edit: 19 Déc 2016 13:03 by papjul.

Please Connexion or Create an account to join the conversation.

More
19 Déc 2016 20:42 #2 by babynus
Hi,

Request recorded as Ticket #2457.

This does not seem to be an urgent feature as Chinees or Japanese users never requested for this.
Also, due to heavy work requested (mostly on testing) and few improvement expected, this is not a priority evolution.

Regards.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
20 Déc 2016 13:15 - 20 Déc 2016 13:15 #3 by papjul
If migration is too difficult, making utf8mb4 the default for newly created database should be a pretty straightforward task.
Thanks anyway,
Last edit: 20 Déc 2016 13:15 by papjul.

Please Connexion or Create an account to join the conversation.

More
22 Déc 2016 09:32 #4 by babynus

making utf8mb4 the default for newly created database should be a pretty straightforward task.

Not so much, as both cases should work for new upgrade scripts...

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
22 Déc 2016 09:45 #5 by papjul
It shouldn't be needed to put charset in SQL update scripts, the DBMS will guess it from the database charset and collation. Plus, the "utf8mb4" is only available in MySQL. The "utf8mb4" is the same as "utf8" in PostgreSQL. However "utf8" in MySQL is something different from other DBMS "utf8" such as PostgreSQL.
I think I will try a migration in my pre-prod environment and will tell you how it's going.
Security of our application is important for us.

Please Connexion or Create an account to join the conversation.

More
23 Déc 2016 12:30 #6 by papjul
After investigating this issue, I discovered that you were actually storing cp1252 data into UTF8 tables.
To be more precise, you store "default character set" of the DBMS, which for MySQL/MariaDB is cp1252 if it was never changed.
You have to do a "SET names utf8;" before making any query on the database, which never happens as $enforceUTF8 is never set. This is weird because in your .sql scripts, all your tables are created in UTF8, so nothing should have prevented connecting to database in UTF8 since you were using UTF8 since the beginnings of ProjeQtOr.

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.072 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.