Cakephp rocks. I just stared making a new site with cakephp and I already had a problem. The mysql encoding did not work properly for my language (greek). I made my database using utf8_unicode_ci but certain character appear wrong.
This is the solution:
Create a new file app_model.php, place it in your app folder. Put the following contents in the file:
PHP:
-
class AppModel extends Model
-
{
-
function __construct($id=false, $table=null, $ds=null)
-
{
-
parent::__construct($id, $table, $ds);
-
$this->execute( "SET NAMES 'UTF8'" );
-
}
-
}
if you are working with scaffolding, put this line in your cake/libs/view/templates/layouts/default.thtml:
PHP:
-
echo $html->
charset('UTF-8');
This info comes from: http://www.get-the-answer.info/comments.php?DiscussionID=5&page=1