Currently the documentation recommends using the following SQL to create a
'utf8' database:
{{{
CREATE DATABASE <dbname> CHARACTER SET utf8;
}}}
Claiming "This ensures all tables and columns will use UTF-8 by default."
Currently in mysql (and mariadb) `utf8` means only a subset of `UTF-8`. To
get the full range one must use `utf8mb4` (which will be the default
somewhere in mysql 8).
I think the advice should be amended to use `utf8mb4` as it is misleading
at the moment. Or at the very least the followup sentence should mention
that `utf8` creates only a subset of characters, and not all utf8 can be
stored in it.
--
Ticket URL: <https://code.djangoproject.com/ticket/31016>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
* version: 2.2 => master
* easy: 1 => 0
* type: Uncategorized => Cleanup/optimization
Comment:
Marking as a duplicate of #18392 because this change is a part of proposed
[https://github.com/django/django/pull/8886 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/31016#comment:1>
Comment (by minusf):
Well if django cannot support `utf8mb4` out of the box at the moment, then
I would argue it's even more important to have a warning about it in the
same section of the documentation...
--
Ticket URL: <https://code.djangoproject.com/ticket/31016#comment:2>