Topic: Question: Why not use utf8mb4 as default?
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello Zhang,
is there any specific reason not to use utf8mb4 by default in MySQL/MariaDB?
I ask because just recently I got an error where an invalid string is reported which was exported from another database:
ERROR 1366 (22007) at line 16: Incorrect string value: '\xF0\x9F\xA4\xAB N...' for column `amavisd`.`msgs`.`from_addr` at row 101
The reason is that \xF0\x9F\xA4\xAB is a utf8mb4 character. In my source table the field was VARBINARY(255) but when importing the data into a field with VARCHAR(255) above error is generated.
When altering the field to use utf8mb4, all works fine.
Above error was encountered in amavisd.msgs table.
Some funny people start using emojis or other special unicode characters in the subject to attract the readers attention.
Saving those in the database should be done with the correct charset IMHO.
I'd recommend using utf8mb4 all over the place.
What do you think?
Any remarks?
Is there any drawback to use utf8mb4? At least in amavisd.msgs table?
Another point of view: When using MySQL Administrator or any other tool, the column is shown as "BLOB", the contents hidden from my eye.
I'd wish to actually see what is saved in the column
Best regards,
Bernhard
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.