Skip to content

Commit 9184c7c

Browse files
author
David Vandemaele
committed
Make client charset configurable
1 parent f77b0fe commit 9184c7c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/Skeleton/Database/Config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ class Config {
5050
* @var boolean $auto_null
5151
*/
5252
public static $auto_null = false;
53+
54+
/**
55+
* Define the client character set.
56+
*
57+
* @access public
58+
* @var string $charset
59+
*/
60+
public static $charset = 'utf8';
5361
}

lib/Skeleton/Database/Driver/Mysqli/Proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function connect() {
8282
throw new \Exception('Could not connect to database: ' . $this->database->connect_error);
8383
}
8484

85-
$this->database->set_charset('utf8');
85+
$this->database->set_charset(\Skeleton\Database\Config::$charset);
8686
$this->connected = true;
8787
}
8888

0 commit comments

Comments
 (0)