Project

General

Profile

Actions

Bug #85524

closed

Charset for DB Connections in LocalConfiguration.php ignored

Added by David Henninger over 6 years ago. Updated over 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 #1

Updated by David Henninger over 6 years ago

  • Is duplicate of Feature #80398: Make default charset and collation for new tables configurable added
Actions #2

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from New to Closed

Closed as a duplicate of #80398 please continue the discussion there - there is already a patch attached. Thank you.

If you think that this is the wrong decision, please reopen it or ping me.

Actions #3

Updated by Sascha Egerer almost 6 years ago

  • Status changed from Closed to Accepted

#80398 is only related to TYPO3 master. But the problem does still exist in TYPO3 8

Actions #4

Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59323

Actions #5

Updated by Gerrit Code Review almost 6 years ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59323

Actions #6

Updated by Gerrit Code Review almost 6 years ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59323

Actions #7

Updated by Gerrit Code Review almost 6 years ago

Patch set 4 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59323

Actions #8

Updated by Sascha Egerer over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Nicole Cordes over 5 years ago

  • Related to Bug #87827: Wrong default database charset applied added
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #11

Updated by Jeff C over 3 years ago

  • Is duplicate of deleted (Feature #80398: Make default charset and collation for new tables configurable)
Actions

Also available in: Atom PDF