Re: Re: Character encoding problem using MDB2
| From: | David Balch | Date: | Sun, 30 Dec 2007 11:12:02 +0000 |
| Subject: | Re: Re: Character encoding problem using MDB2 | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28373@lists.php.net to get a copy of this message | ||
Hi Carsten,
Brilliant, setCharset() works, thank you!
Setting it in the DSN didn't seem to work though, maybe I had the
syntax slightly out:
$dsn = 'mysqli://user:pass@localhost/db?charset=UTF8';
Cheers,
Dave.
On Dec 30, 2007 10:57 AM, Carsten Wiedmann <carsten_sttgt@gmx.de> wrote:
> David Balch schrieb:
> > It looks like MDB2 is returning the data as ISO-8859-1, as when I set
> > the page's character encoding to ISO-8859-1, the special characters
> > display ok (and some other characters on the page don't).
> >
> > Any ideas where I should look to solve this?
>
> You can set the charset with setCharset() [1] or as Option in the connection
> DSN. (default charset for the PHP mysql client is Latin1)
>
> Regards,
> Carsten
>
> [1]
>
> http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Common.html#methodsetCharset
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>