Character set converter for database tables.

This class is used to upgrade tables from "utf8" character set encoding to "utf8mb4" encoding. This allows for uses of 4 byte characters such as emoji and mathematical symbols.

In Backdrop this conversion may be done through UI at admin/config/development/utf8mb4-upgrade. More information about this upgrade can be found in the Backdrop documentation on database configuration: https://docs.backdropcms.org/documentation/database-configuration

Although this class is used within Backdrop purely for the utf8mb4 upgrade, it is a general purpose converter and could be used for other purposes in custom scripts or command-line tools.

Based on utf8mb4_convert https://www.drupal.org/project/utf8mb4_convert by joelpittet and stefan.r.

Hierarchy

Expanded class hierarchy of DatabaseCharsetConverter

See also

system_utf8mb4_convert_form()

_system_utf8mb4_convert_batch()

File

core/includes/database/charset_converter.inc, line 24

Members

Contains filters are case sensitive
Name Modifiers Type Descriptionsort descending
DatabaseCharsetConverter::convertDatabase public function Convert the database charset and collation, but not the tables within it.
DatabaseCharsetConverter::convertAllDatabases public function Convert the MySQL Backdrop databases character set and collation.
DatabaseCharsetConverter::convertTable public function Converts a table to a desired character set and collation.
DatabaseCharsetConverter::convertTableFields public function Converts a table's field to a desired character set and collation.
DatabaseCharsetConverter::convertTables public function Converts all the tables defined by backdrop_get_schema().
DatabaseCharsetConverter::__construct public function DatabaseCharsetConverter constructor.
DatabaseCharsetConverter::$charset protected property Default character set to which data should be converted.
DatabaseCharsetConverter::$collation protected property Default collation to which data should be converted.
DatabaseCharsetConverter::setConnection public function Set the active connection for all operations.
DatabaseCharsetConverter::$connection protected property The current connection for all operations.