We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

font utf8 error

Hi all How to config utf8

return new \Phalcon\Config(array(
  'database' => array(
      'adapter'     => 'Mysql',
      'host'        => '127.0.0.1',
      'username'    => 'root',
      'password'    => '[email protected]',
      'dbname'      => 'vokuro',
      'options' => array(
          PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
          ) 

and html <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> but errors ,when save in database https://dl.dropboxusercontent.com/u/109046499/Selection_019.png



58.4k
edited Mar '14

I slove problem above

$di->set('db', function() use ($config) {
    return new DbAdapter(array(
        'host' => $config->database->host,
        'username' => $config->database->username,
        'password' => $config->database->password,
        'dbname' => $config->database->dbname,
        'charset'=> 'utf8'
    ));
});

Glad you got it working :)