I'm having a problem with CakePHP. My application is not echoing out any non-English character(ñ,á,é). I'm not having that problem with raw PHP but the framework seems to be working odd about the encoding.
I've already tried putting this line in the header of the layout files but it keeps failing:
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
Make sure you have saved your file with UTF-8 encoding.
Where do you get your data from? You have to set the correct encoding (utf8?) for your database connection. If you get input from other sources you can use iconv to convert the data to utf8.
http://php.net/manual/de/book.iconv.php
But be aware, that you should know the encoding of your input data, otherwise it is hard or almost impossible to figure your source charset out.
make sure that your database configuration has the encoding enabled.
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => '',
'database' => 'XXX',
'prefix' => 'XXX_',
'encoding' => 'utf8',
);
精彩评论