mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
ENHANCEMENT: Switch MSSQL to use the utf8 character set for the connection.
This commit is contained in:
parent
8e28fc70f6
commit
07ea9353e1
@ -100,6 +100,8 @@ class MSSQLDatabase extends SS_Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($this->mssql) {
|
if($this->mssql) {
|
||||||
|
// Switch to utf8 connection charset
|
||||||
|
ini_set('mssql.charset', 'utf8');
|
||||||
$this->dbConn = mssql_connect($parameters['server'], $parameters['username'], $parameters['password'], true);
|
$this->dbConn = mssql_connect($parameters['server'], $parameters['username'], $parameters['password'], true);
|
||||||
} else {
|
} else {
|
||||||
// Disable default warnings as errors behaviour for sqlsrv to keep it in line with mssql functions
|
// 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(
|
$connectionInfo = array(
|
||||||
'UID' => $parameters['username'],
|
'UID' => $parameters['username'],
|
||||||
'PWD' => $parameters['password'],
|
'PWD' => $parameters['password'],
|
||||||
|
'CharacterSet' => 'utf8',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->dbConn = sqlsrv_connect($parameters['server'], $connectionInfo);
|
$this->dbConn = sqlsrv_connect($parameters['server'], $connectionInfo);
|
||||||
|
Loading…
Reference in New Issue
Block a user