Page 1 of 1
Display unicode data incorrectly
Posted: Sun Apr 01, 2007 11:31 pm
by hoangvu.che
I have configured MySQL default encoding to utf-8.
Some unicode data is input by hand.
My php page loads the entered unicode data. However, the unicode characters are not displayed correctly although I have set the page encoding to utf-8 and save the php file in unicode format.
I dont know whether I need to configure anything else. Please help me.
thanks.
Posted: Mon Apr 02, 2007 12:39 am
by feyd
How did you specify the page encoding?
Posted: Mon Apr 02, 2007 1:50 am
by hoangvu.che
I write the below line in the head section:
Code: Select all
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
Posted: Mon Apr 02, 2007 7:31 am
by feyd
So you didn't also call
header() with that information?
Posted: Mon Apr 02, 2007 11:05 am
by hoangvu.che
I am really a junior in web coding. I actually dont understand how to do with the function header() as your instruction.
Could you explain more details?
Posted: Mon Apr 02, 2007 11:16 am
by feyd
You probably need to pass the Content-type header through header() as well as in the page data. There's an example of it on the documentation page. You already have the values needed to call it.
Posted: Mon Apr 02, 2007 9:23 pm
by hoangvu.che
I have added the following line at the beginning of my page
Code: Select all
header('Content-Type: text/html; charset=UTF-8');
However, no change occurs

Posted: Mon Apr 02, 2007 9:37 pm
by feyd
Did you make sure to delete all your cache data to make sure you are looking at the correct version of the page?
Posted: Mon Apr 02, 2007 10:04 pm
by hoangvu.che
yes, sure.
I have also cleared all cache data before reload the page.