Re: Re: PDO don't know which is mysql server charset?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, so if a multibyte character string is provided and is stored in what is essentially a single byte per character field in the database, as long as all the extra bytes are saved, reading it back will be OK ... unless the bytes are then processed to another character set before saving! THEN as long as the 'unprocessing' when you read back is transparent, the data will read OK, but trying to read the data directly in the database would not give the same result. Your request to read back as gbk will only work if what was stored can actually be correctly converted to gbk!

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux