[BUGFIX] Use UTF-8 as default character set when creating new databases
authorMichael Stucki <michael.stucki@typo3.org>
Thu, 31 Mar 2011 21:33:39 +0000 (23:33 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Thu, 31 Mar 2011 22:05:58 +0000 (00:05 +0200)
When creating a new database in the Install Tool, UTF-8 should be
set as the default character set.

Thanks to Kian Gould (AOE Media) for sponsoring this fix with
250 beers during the bug auction at T3BOARD11.

Change-Id: I0584bfe1e6c50e4a7ea462d0196a45861d2c4d0e
Resolves: #22933
Reviewed-on: http://review.typo3.org/1375
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
typo3/sysext/install/mod/class.tx_install.php

index 7d6b267..6053450 100755 (executable)
@@ -3739,7 +3739,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                $newdbname=trim($this->INSTALL['localconf.php']['NEW_DATABASE_NAME']);
                                                if (!preg_match('/[^[:alnum:]_-]/',$newdbname)) {
                                                        if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
-                                                               if ($GLOBALS['TYPO3_DB']->admin_query('CREATE DATABASE '.$newdbname)) {
+                                                               if ($GLOBALS['TYPO3_DB']->admin_query('CREATE DATABASE ' . $newdbname . ' CHARACTER SET utf8')) {
                                                                        $this->INSTALL['localconf.php']['typo_db'] = $newdbname;
                                                                        $this->messages[]= "Database '".$newdbname."' created";
                                                                } else {