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

2010-05-21 Thread cleverpig
really thanks! This is so clear explanation! I'd set anything to utf-8,including server,client,my php PDO. but it didn't work,sounds like my data were encoded (processed) to another character(gbk) before them were saved into mysql. so when i checked data from mysql,i will make a hardcode to decod

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

2010-05-21 Thread Peter Lind
On 21 May 2010 10:47, Lester Caine wrote: > Peter Lind wrote: >>> >>> 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 >

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

2010-05-21 Thread Lester Caine
Peter Lind wrote: 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 * ph

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

2010-05-21 Thread Peter Lind
On 21 May 2010 10:16, Lester Caine 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 docum

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

2010-05-21 Thread Lester Caine
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

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

2010-05-21 Thread cleverpig
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? 2010/5/21 Lester Caine : > cleverpig wrote: >> But if I use PDO's query function,there is all right without set charset: >> $res

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

2010-05-21 Thread Lester Caine
cleverpig wrote: > But if I use PDO's query function,there is all right without set charset: > $result=$myPDO->query("SELECT * FROM guests ORDER BY lname,fname"); > while($row=$result->fetch(PDO::FETCH_ASSOC)){ > echo $row["fname"]." ". $row["lname"]; > } > >> I encountered a problem using t

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

2010-05-20 Thread cleverpig
But if I use PDO's query function,there is all right without set charset: $result=$myPDO->query("SELECT * FROM guests ORDER BY lname,fname"); while($row=$result->fetch(PDO::FETCH_ASSOC)){ echo $row["fname"]." ". $row["lname"]; } 2010/5/21 cleverpig : > hi, everybody! > > I encountered a pr