5

Can someone tell me how to set the DB charset from, let's say, utf-8 to latin2 or something like this?

Tried to google it but found nothing that could help... Also, I tried this method but for some reason this does not work for me...

P.S: I also tried to change it from main.php file under 'charset' which was default to utf-8 but it still does not work... I forgot to mention.

L.E: as you asked, this is the db setting:

'db' => array(
        'connectionString' => 'mysql:host=localhost;dbname=dbname',
        'emulatePrepare' => true,
        'username' => 'user',
        'password' => 'pass',
        'charset' => 'latin2',
        'initSQLs'=>'SET NAMES latin2;'
        'tablePrefix' => '',
        //'enableParamLogging' => true,
        //'enableProfiling'=>true,
    ),

Any ideas? Thanks...

1 Answers1

3

What you are looking for is 'charset=utf8mb4'

which would result in

'db' => array(
        'connectionString' => 'mysql:host=localhost;dbname=dbname',
        'emulatePrepare' => true,
        'username' => 'user',
        'password' => 'pass',
        'charset' => 'utf8mb4',
        'initSQLs'=>'SET NAMES latin2;'
        'tablePrefix' => '',
        //'enableParamLogging' => true,
        //'enableProfiling'=>true,
    ),
DarkMukke
  • 2,469
  • 1
  • 23
  • 31
  • http://stackoverflow.com/questions/11533448/utf8-general-ci-or-utf8mb4-or most people go for latin2 instead of utf-8 since utf8 does not hold all the characters, with utf8mb4 (which is a better version of utf8, kinda like utf32) you have everything you need for latin2 – DarkMukke Sep 25 '14 at 14:18