#18392: Make MySQL backend default to utf8mb4 encoding
-------------------------------------+-------------------------------------
Reporter: EmilStenstrom | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.4
(models, ORM) |
Severity: Normal | Resolution:
Keywords: utf8mb4 mysql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by lambdaq):
I submitted a utf8mb4 fix on github and was redirected here to this old
relic.
https://github.com/django/django/pull/14563
Lots of stuff had changed since the issue was first open two years ago. My
two cents:
1. In 5.7, innodb indexes no longer limits the 767 bytes hardcap on
utf8mb4 indexes.
> When innodb_file_format is set to Barracuda, innodb_large_prefix=ON
allows index key prefixes longer than 767 bytes (up to 3072 bytes) for
tables that use a Compressed or Dynamic row format.
2. MySQL 8 will default use db-wide utf8mb4
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html#mysqld-8-0-1-charset
I guess Django's decision to hack MySQL's default settings to less
supported utf8mb3 (aka the utf8) would be unwise. It was a proper
compromise 9 years ago, but it will be a liability in the years to come.
Maybe at least we can add some notes to alarm the readers?
CREATE DATABASE <dbname> CHARACTER SET utf8;
This would be a huge misleading mistake on official Django doc.
@felixxm @pope1ni
--
Ticket URL: <https://code.djangoproject.com/ticket/18392#comment:48>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.4277307613d0691762d95ab9d5ad4c87%40djangoproject.com.