Skip to content
Snippets Groups Projects
Commit 51880da4 authored by Demian Katz's avatar Demian Katz
Browse files

Added configuration setting to allow DB character set specification; now defaults to UTF-8.

parent a9acceb0
No related merge requests found
...@@ -259,6 +259,11 @@ require_login = true ...@@ -259,6 +259,11 @@ require_login = true
[Database] [Database]
database = mysql://root@localhost/vufind database = mysql://root@localhost/vufind
; The character set of the database -- may be latin1 or utf8; utf8 is STRONGLY
; RECOMMENDED and is the default if no value is set here. You may need latin1
; for compatibility with existing VuFind 1.x installations.
;charset = utf8
; LDAP is optional. This section only needs to exist if the ; LDAP is optional. This section only needs to exist if the
; Authentication Method is set to LDAP. When LDAP is active, ; Authentication Method is set to LDAP. When LDAP is active,
; host, port, basedn and username are required. The remaining ; host, port, basedn and username are required. The remaining
......
...@@ -112,6 +112,9 @@ class AdapterFactory ...@@ -112,6 +112,9 @@ class AdapterFactory
// Set up custom options by database type: // Set up custom options by database type:
switch (strtolower($type)) { switch (strtolower($type)) {
case 'mysqli': case 'mysqli':
$config = ConfigReader::getConfig();
$options['charset'] = isset($config->Database->charset)
? $config->Database->charset : 'utf8';
$options['options'] = array('buffer_results' => true); $options['options'] = array('buffer_results' => true);
break; break;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment