• 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!


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

$db = Zend_Db::factory($dbConfig->adapter,
        '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:

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


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