Accentuation with most up-to-date server problems [duplicate]

2

I have 2 servers with the following settings:

Server 1:

  

PHP 5.3.10
  Apache 2.2.22
  MySql 5.5.43
  Ubuntu 12.04.5 LTS

Server 2:

  

PHP 5.6.9
  Apache 2.4.7
  MySql 5.5.43
  Ubuntu 14.04.2 LTS

I'm using the Yii framework.

The problem is that on server 1 the word "dog" appears normally, on server 2 it appears "dog".

Server 2 is a copy of server 1 but we changed Apache / PHP / OS.

What might be the source of the problem? What version of the operating system?

    
asked by anonymous 16.06.2015 / 15:18

1 answer

0
Assuming you are using Yii version 2.x, check the bank configuration file (% with%) if charset is set to utf-8:

return [
   'class' => 'yii\db\Connection',
   'dsn' => 'mysql:host=localhost;dbname=banco', 
   'username' => 'root', 
   'password' => '', 
   'charset' => 'utf8',
];

Also check the layout file or views if the UTF-8 charset is set.

    
06.07.2015 / 20:49