Bug #85524

Charset for DB Connections in LocalConfiguration.php ignored

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

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

Actions
Is duplicate of TYPO3 Core - Feature #80398: Make default charset and collation for new tables configurableClosed2017-03-22

Actions
#1

Updated by David Henninger over 2 years ago

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

Updated by Riccardo De Contardi over 2 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.

#3

Updated by Sascha Egerer almost 2 years ago

  • Status changed from Closed to Accepted

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

#4

Updated by Gerrit Code Review almost 2 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

#5

Updated by Gerrit Code Review almost 2 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

#6

Updated by Gerrit Code Review almost 2 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

#7

Updated by Gerrit Code Review almost 2 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

#8

Updated by Sascha Egerer almost 2 years ago

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

Updated by Nicole Cordes over 1 year ago

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

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF