Re: Re: PDO don't know which is mysql server charset?
| From: | Peter Lind | Date: | Fri, 21 May 2010 08:23:01 +0000 |
| Subject: | Re: Re: PDO don't know which is mysql server charset? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305379@lists.php.net to get a copy of this message | ||
On 21 May 2010 10:16, Lester Caine <lester@lsces.co.uk> wrote:
> cleverpig wrote:
>>
>> thanks Lester!
>>
>> What's double decode? Your meaning is like What's i said:
>> using $ Pdo-> exec ('SET character_set_results = gbk');
>> to make charset_set_results to be gbk?
>
> http://tikiwiki.org/UTF-8 seems to have documented everything
> ;)
>
> Basically if the data going into a field is wrong, as long as it is read out
> the right way then it will LOOK OK, but if you don't know how the data is
> stored then 'decoding' it may be difficult. I'm not sure quite how PDO will
> handle your gbk data, although in that case it would be single byte and any
> multi byte characters would be dropped ... I think.
>
> The problem here is that PHP still does not know how to handle UTF8
> properly
It's not *just* that PHP isn't handling utf8 perfectly. Encoding
between database and server is a rather complex issue, you're dealing
with:
* database encoding
* database connection encoding
* php internal encoding
* output encoding
Messing up just *one* of these will give bad output - so you need to
make sure that all of them are aligned.
Regards
Peter
--
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>