function change_db_encoding() {
global $CFG, $db;
// try forcing utf8 collation, if mysql db and no tables present
- if (!$db->Metatables() && ($CFG->dbtype=='mysql')) {
+ if (!$db->Metatables() && ($CFG->dbtype=='mysql') && empty($CFG->unicodedb)) {
$SQL = 'ALTER DATABASE '.$CFG->dbname.' CHARACTER SET utf8';
execute_sql($SQL, false); // silent, if it fails it fails
+ if (setup_is_unicodedb()) {
+ // set_config('unicodedb','true'); // can not set config because there is no config table yet =(
+ configure_dbconnection();
+ }
}
}