• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug XF does not allow config.php to define charset!

Jaxel

Well-known member
#1
library/XenForo/Application.php :: line 713

Code:
$db = Zend_Db::factory($dbConfig->adapter,
    array(
        'host' => $dbConfig->host,
        'port' => $dbConfig->port,
        'username' => $dbConfig->username,
        'password' => $dbConfig->password,
        'dbname' => $dbConfig->dbname,
        'adapterNamespace' => $dbConfig->adapterNamespace,
        'charset' => 'utf8'
    )
);
This code, hard-codes the charset of the database connection to utf8. So if I were to put into my config.php the following, it would be ignored:

Code:
$config['db']['charset'] = 'utf8mb4';
My recommendation is to set utf8 as the default, and allow us to define a custom charset for the connection.
 

Mike

XenForo developer
Staff member
#2
This is really as designed and there are further changes that would need to be made to do what you want.