Project

General

Profile

Actions

Bug #85524

closed

Charset for DB Connections in LocalConfiguration.php ignored

Added by David Henninger almost 6 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2018-07-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87827: Wrong default database charset appliedClosedNicole Cordes2019-03-03

Actions
Actions

Also available in: Atom PDF