Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using utf8mb4 (utf8mb4_unicode_ci) in MySQL/MariaDB #7113

Closed
ghost opened this issue Dec 13, 2019 · 3 comments
Closed

Consider using utf8mb4 (utf8mb4_unicode_ci) in MySQL/MariaDB #7113

ghost opened this issue Dec 13, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 13, 2019

For performance reasons (or maybe just by mistake) someone in MySQL decided to break UTF-8 and not support the whole 4-bytes, instead they used only 3-bytes and thus MySQL was notorious for not supporting many UTF-8 characters.

Time has passed since then and both MySQL and MariaDB support the full UTF-8 set. But because the charset name "utf8" implied the broken set, the correct set is instead named as "utf8mb4", so that now matches what the rest of the world knows as UTF-8.

Please consider converting your tables to utf8mb4 (collate utf8mb4_unicode_ci), so that the full UTF-8 set is supported.

I believe there was a similar discussion with issue #6535

Thank you.

@alecpl
Copy link
Member

alecpl commented Dec 13, 2019

Yes, this is planned for 1.5.

alecpl added a commit that referenced this issue Feb 1, 2020
@alecpl
Copy link
Member

alecpl commented Feb 1, 2020

Done.

@alecpl alecpl closed this as completed Feb 1, 2020
@ghost
Copy link
Author

ghost commented Feb 1, 2020

Thank you for the prompt response and fix.

I'd like add an important note for posterity reasons. In older MySQL/MariaDB 5.x versions, there is an issue with VARCHAR(255). A column defined as such, will break the conversion because of a limit in the index.

There are several solutions:

  • upgrade to a newer MySQL/MariaDB version,
  • increase the index limit
  • alter the table to VARCHAR(190), if I remember correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant