Bug #85524
closedCharset for DB Connections in LocalConfiguration.php ignored
100%
Description
Currently, the charset value in the DB Connection is being ignored, so Typo3 defaults to utf8, no matter what charset you put in there. Example:
[
'DB' => [
'Connections' => [
'Default' => [
'charset' => 'utf8mb4',
'driver' => 'mysqli',
'host' => '127.0.0.1',
'port' => 3306,
'dbname' => 'typo3',
'user' => 'typo3',
'password' => 'typo3',
],
],
]
]
Even with MySQL/MariaDB fully configured to use utf8mb4, Typo3 sticks with utf8 and throws the appropriate error:
"It looks like the character set utf8 is not used for this connection even though it is configured as connection charset. This TYPO3 installation is using the $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] property with the following value: "". Please make sure that this command does not overwrite the configured charset. Please note that for the TYPO3 database everything other than utf8 is unsupported since version 4.7."
As the error suggests, Typo3 8.7.16 doesn't seem to accept anything beside utf8, so it ignores the option entirely. Directly changing the default to utf8mb4 in sysext/core/Classes/Database/DatabaseConnection.php, but this hack really should not be used.
Unfortunately, without utf8mb4 and just 3-byte utf8, most Emojis are not supported, so switching to utf8mb4 is the only way to get it working. The same issue came up in #71454 already and got "solved": Maybe it has stopped working since then, maybe it never did, either way, currently it's just not working.