in cake 1.1 I usually add
to my app_model.php for the project
class AppModel extends Model {
function __construct($id = null, $table = null, $ds = null)
{
parent::__construct($id, $table, $ds);
if (!defined('MYSQL_SET_NAMES_UTF8') && $this->useTable!==false)
{
$this->execute("SET NAMES 'UTF8'");
define('MYSQL_SET_NAMES_UTF8', true);
}
}
}
I can't remember where I got this probably from AD6 or M.I.
On 8/31/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> Does anybody know how to save utf8 charachters properly in Cake.. when
> i save special characters they get saved very weird in mysql for
> exmaple: ���� becomes öööö
>
> The database table is set to utf8_general_ci and in the html it is set
> to utf8 too.. <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
>
> The problem seems to come when saving to mysql, does anybody know how
> i can fix this ?
>
>
> >
>
--
(the old fart) the advice is free, the lack of crankiness will cost you
- its a fine line between a real question and an idiot
http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---