Bug #22933
closed
Install tool should by default create database with utf8 charset
Added by Michiel Roos over 14 years ago.
Updated about 6 years ago.
Description
The installer creates a database with Latin1 caharacter set as default.
mysql> show create database intro;
--------------------------------------------------------------------------+ | Database | Create Database |
--------------------------------------------------------------------------+ | intro | CREATE DATABASE `intro` /*!40100 DEFAULT CHARACTER SET latin1 */ |
--------------------------------------------------------------------------+
1 row in set (0.01 sec)
This should look like:
mysql> show create database intro;
------------------------------------------------------------------------+ | Database | Create Database |
------------------------------------------------------------------------+ | intro | CREATE DATABASE `intro` /*!40100 DEFAULT CHARACTER SET utf8 */ |
------------------------------------------------------------------------+
1 row in set (0.00 sec)
Which is the result of creating a database using: CREATE DATABASE intro CHARACTER SET utf8 COLLATE utf8_general_ci;
(issue imported from #M14787)
TYPO3 just uses the MySQL defaults. And MySQL uses the character set setting from the default database.
If that is utf8, utf8 will also be used for your new DB.
I think [SYS][setDBinit] is the variable the Install Tool should use:
You should set this to
SET NAMES utf8;
SET SESSION character_set_server=utf8;
This guarantees that not only all incoming data is seen as UTF-8 encoded, but that also the default charset is set to UTF-8. This default charset is used when creating a new DB.
But then we still have the problem: What shall we do, when TYPO3 is set up for the first time (I think that is what we are speaking of)?
In that case the user has not set anything in the Install Tool yet.
I propose to predefine the value for [SYS][setDBinit] in the dummy package by setting it in localconf.php.
And if we already do this, it is also easy to add [BE][forceCharset] = utf-8 to set BE and FE to UTF-8, too, preventing the possibility of seeing broken special chars.
Right,
We can add that to the packager for the introduction package.
Can it be added to the TYPO3 defaults too?
- Status changed from New to Accepted
- Assignee set to Michael Stucki
- Target version deleted (
0)
Patch set 1 of change I0584bfe1e6c50e4a7ea462d0196a45861d2c4d0e has been pushed to the review server.
It is available at http://review.typo3.org/1375
Patch set 2 of change I0584bfe1e6c50e4a7ea462d0196a45861d2c4d0e has been pushed to the review server.
It is available at http://review.typo3.org/1375
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF