Outline ·
[ Standard ] ·
Linear+
asp.net <--> mysql, cannot display chinese why??
TSerictioh84
|
Feb 16 2006, 03:38 PM, updated 19y ago
|
|
i have a table in my database, 1 of the column i have set it to utf8 encoding using the following command :
alter table myTable column myColumn character set=utf8;
now in the webhosting ctrl panel's phpmyadmin, it can display chinese well but when i query out in my webpage it shows ????. why?
i have added CHARSET=utf8 in my connection string already but still the same. any idea?"
|
|
|
|
silverhawk
|
Feb 17 2006, 01:19 PM
|
I'm Positively Lustrous
|
First, check that your page is also using charset=utf-8 so the browser can auto detect the character set. the html code to add to the header is CODE <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
TSerictioh84
|
Feb 17 2006, 08:39 PM
|
|
already added this line, nothing changed also. anyone can explain to me more what's the different between utf8 and gb2312 and big5?
|
|
|
|
silverhawk
|
Feb 17 2006, 08:48 PM
|
I'm Positively Lustrous
|
The main difference is how they are stored in bytes. Read this for some direction: http://en.wikipedia.org/wiki/Character_encodingWhat browser do you use? Try going to view -> Character Encoding in firefox and select one of the chinese encoding methods and see whether the text got display or not.
|
|
|
|
Eventless
|
Feb 17 2006, 08:58 PM
|
|
UT8 or Unicode is designed to represent all the characters for all the languages in the world. So theoretically means that you can use it to display any language that you can think of using that character encodiing system.
The two main character encoding for chinese characters are gb2312 for simplified chinese(used in Mainland China) and Big 5 for traditional chinese (used in Taiwan).
The chinese input used in Windows 2000 and above uses gb2312 for simplified chinese and Big 5 for traditional chinese so there's no way to enter UTF8 by default. Better stick to gb2312 or Big 5 for a chinese web site at the moment.
How exactly are you entering UTF8 for chinese characters into your database?
|
|
|
|
silverhawk
|
Feb 17 2006, 10:26 PM
|
I'm Positively Lustrous
|
Well, he said phpmyadmin displays it properly so i assume the data is stored correctly and its just being intepreted wrongly
|
|
|
|
Eventless
|
Feb 18 2006, 07:41 AM
|
|
There's two places where this thing could go wrong. During entry and during output. If you enter the text as something other than utf-8 and you specify utf-8 as the charset to use, you won't be able to see the page correctly. The other scenario would be the text is entered as utf-8 and using the wrong charset in the html file. Since this one would be solved by the solution given in the second post, this is probrably not the case. Without knowing how the data is entered into the system, it's hard to determine where exactly the system went wrong.
|
|
|
|
TSerictioh84
|
Feb 23 2006, 05:53 PM
|
|
i got my solution. all these are because the ODCB driver. i changed to use mysql.net driver then everything ok....
|
|
|
|