1. 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!

Discussion in 'Resolved Bug Reports' started by Jaxel, Oct 20, 2015.

  1. Jaxel

    Jaxel Well-Known Member

    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.
     
  2. Mike

    Mike 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.
     
  3. Jaxel

    Jaxel Well-Known Member

    Then I guess I just have to manually edit Application.php to use utf8mb4.
     

Share This Page