WordPress.org

Make WordPress Core

Opened 4 days ago

Last modified 3 days ago

#48285 assigned enhancement

wp-config-sample.php should default to `utf8mb4` instead of `utf8` character set

Reported by: bchecketts Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: trunk
Component: Database Keywords:
Focuses: Cc:
PR Number:

Description

MySQL's utf8 character encoding is not a correct implementation of the standard and doesn't work with 4-byte characters, which includes many emoji. utf8mb4 is the corrected implementation.

See https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434 or just google "mysql utf8 vs utf8mb4"

It would seem wise for wp-config-sample.php to default then to utf8mb4 instead of utf8 so that new installations have the improved character set.

Change History (1)

#1 @SergeyBiryukov
3 days ago

  • Component changed from Charset to Database

Previously: #21212, #32405, #33122.

Thanks for the ticket!

On both new and existing WordPress installs, WordPress will automatically upgrade the tables to utf8mb4 if the server supports that, and when DB_CHARSET is defined as utf8, it will automatically switch to utf8mb4 instead.

wp-config-sample.php still needs to default to utf8 though, as not all sites can support utf8mb4.

Note: See TracTickets for help on using tickets.