ENHANCEMENT: Switch MSSQL to use the utf8 character set for the connection.

This commit is contained in:
Sam Minnee 2010-06-03 00:58:31 +00:00
parent 8e28fc70f6
commit 07ea9353e1

View File

@ -100,6 +100,8 @@ class MSSQLDatabase extends SS_Database {
}
if($this->mssql) {
// Switch to utf8 connection charset
ini_set('mssql.charset', 'utf8');
$this->dbConn = mssql_connect($parameters['server'], $parameters['username'], $parameters['password'], true);
} else {
// Disable default warnings as errors behaviour for sqlsrv to keep it in line with mssql functions
@ -114,6 +116,7 @@ class MSSQLDatabase extends SS_Database {
$connectionInfo = array(
'UID' => $parameters['username'],
'PWD' => $parameters['password'],
'CharacterSet' => 'utf8',
);
}
$this->dbConn = sqlsrv_connect($parameters['server'], $connectionInfo);