#31016 closed Cleanup/optimization (duplicate)
Documentation: MySQL notes: utf8.
Reported by: | minusf | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | mysql mariadb utf8 utf8mb4 |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
https://docs.djangoproject.com/en/2.2/ref/databases/#creating-your-database
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.
Change History (2)
comment:1 by , 5 years ago
Easy pickings: | unset |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | Documentation: MySQL notes: utf8 → Documentation: MySQL notes: utf8. |
Type: | Uncategorized → Cleanup/optimization |
Version: | 2.2 → master |
comment:2 by , 5 years ago
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...
Marking as a duplicate of #18392 because this change is a part of proposed PR.