diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-06-10 14:18:41 -0400 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-06-10 14:18:41 -0400 |
commit | ba6beaa3104c81b8b6e624aad28c9f0ce89af8dc (patch) | |
tree | ceed868811c836ab46d60c6c73ab6f386b75d8d6 /classes/Memcached_DataObject.php | |
parent | e120cb1a5300f2e38820aa05ec9ac21073a934e0 (diff) | |
parent | 5469e46ef5bd464559a648fdc02b285313132155 (diff) |
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'classes/Memcached_DataObject.php')
-rw-r--r-- | classes/Memcached_DataObject.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 52ad4100f..33ac70dd0 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -239,8 +239,14 @@ class Memcached_DataObject extends DB_DataObject $result = parent::_connect(); if (!$exists) { $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; - if (common_config('db', 'utf8')) { - $DB->query('SET NAMES "utf8"'); + if (common_config('db', 'type') == 'mysql' && + common_config('db', 'utf8')) { + $conn = $DB->connection; + if ($DB instanceof DB_mysqli) { + mysqli_set_charset($conn, 'utf8'); + } else if ($DB instanceof DB_mysql) { + mysql_set_charset('utf8', $conn); + } } } return $result; |