Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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 Mariusz Felisiak, 4 years ago

Easy pickings: unset
Resolution: duplicate
Status: newclosed
Summary: Documentation: MySQL notes: utf8Documentation: MySQL notes: utf8.
Type: UncategorizedCleanup/optimization
Version: 2.2master

Marking as a duplicate of #18392 because this change is a part of proposed PR.

comment:2 by minusf, 4 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...

Note: See TracTickets for help on using tickets.
Back to Top