fix UTF-8 encoding
This commit is contained in:
24
current_version/config.php
Normal file → Executable file
24
current_version/config.php
Normal file → Executable file
@@ -162,6 +162,30 @@ function connection()
|
||||
addMessage(getError(array('Impossible de sélectionner la base de données "'.DB_NAME.'"', 'Changez les constantes dans le fichier "'.SETTINGS_FILE.'" ou réinstaller la base de données'), true));
|
||||
$_GET['page'] = 'install';
|
||||
}
|
||||
|
||||
//php settings
|
||||
date_default_timezone_set(TIMEZONE);
|
||||
ini_set('default_charset', TEXT_ENC);
|
||||
header('Content-Type: text/html; charset='.TEXT_ENC);
|
||||
mb_internal_encoding(TEXT_ENC);
|
||||
mb_http_output(TEXT_ENC);
|
||||
mb_http_input(TEXT_ENC);
|
||||
mb_language('uni');
|
||||
mb_regex_encoding(TEXT_ENC);
|
||||
|
||||
//Characters encoding
|
||||
mysql_set_charset(DB_ENC, $oConnection);
|
||||
|
||||
//Time zone
|
||||
$oNow = new DateTime();
|
||||
$iMins = $oNow->getOffset() / 60;
|
||||
$iSign = ($iMins < 0)?-1:1;
|
||||
$iMins = abs($iMins);
|
||||
$iHours = floor($iMins / 60);
|
||||
$iMins -= $iHours * 60;
|
||||
$sOffset = sprintf('%+d:%02d', $iHours*$iSign, $iMins);
|
||||
setQuery("SET time_zone='{$sOffset}';");
|
||||
|
||||
return $oConnection;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user