Monday, November 3, 2008

Re: database is utf-8, page is utf-8, but i get weird characters

setting the encoding in the database connection was the trick.
however, with this problem fixed weird things started up showing in
other places. turns out you have to specify UTF-8 when you use
htmlentities as well. i solved this by defining my own

function utfentities($string) {
return htmlentities($string, ENT_COMPAT, 'UTF-8');
}

and using that instead of htmlentities


On 3 nov, 17:55, "Marcelo Andrade" <mfandr...@gmail.com> wrote:
> On Mon, Nov 3, 2008 at 8:48 AM, martin.westin...@gmail.com
>
> <martin.westin...@gmail.com> wrote:
>
> > There is also an application-global encoding setting in config/
> > core.php
>
> I'm a new at this list and I don't know if it was already covered,
> but I solve these problems setting UTF-8 as default charset
> at Apache.  Put/change this line in your httpd.conf
>
> AddDefaultCharset UTF-8
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE (aka "eleKtron")
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> [gus@pará ~]# linkshttp://pa.slackwarebrasil.org/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: