From 8e5898a11b8c35e8af91230719b9761a5ec6a54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20H=C5=AFla?= Date: Wed, 10 Apr 2013 11:08:31 +0200 Subject: [PATCH] DibiMsSql2005Driver: default charset set to UTF-8 If charset is not specified in config, NULL is passed as connection option and 'Invalid value type for option CharacterSet was specified. String type was expected.' is thrown. --- dibi/drivers/mssql2005.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dibi/drivers/mssql2005.php b/dibi/drivers/mssql2005.php index 999c5fd4..d661a8c0 100644 --- a/dibi/drivers/mssql2005.php +++ b/dibi/drivers/mssql2005.php @@ -73,6 +73,9 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult $this->connection = $config['resource']; } else { + // Default values + if (!isset($config['options']['CharacterSet'])) $config['options']['CharacterSet'] = 'UTF-8'; + $this->connection = sqlsrv_connect($config['host'], (array) $config['options']); }