From 07ea9353e110249e8626dc8aeddd72fed5b97cc1 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 3 Jun 2010 00:58:31 +0000 Subject: [PATCH] ENHANCEMENT: Switch MSSQL to use the utf8 character set for the connection. --- code/MSSQLDatabase.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index 7104ee6..0b1aa42 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -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);