Today I was working on a CakePHP 2.1 project and when I was doing:
1 |
$this->Modelo->find('list') |
my result was coming with encoding errors.
As usual, I went to check de header layout, to be sure that I used UTF-8:
1 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
Then I checked the core.php to be sure it was defined with UTF-8:
1 |
Configure::write('App.encoding', 'UTF-8'); |
Also checked the database connection at database.php to be sure it was using UTF-8:
1 |
'encoding' => 'utf8' |
Everything was ok on all files. What could it be then? The only possible reason was MySQL not being configured with utf-8 on table and fields…