|
|
 |
RE: FN-FORUM: PHP and Chinese Characters
date posted 12th October 2007 15:33
Hi Rob,
I've just been through this converting an ASP.NET 1.1 VB/MySQL 5.0 site from
Latin to UTF-8 to allow entry and display of Chinese characters. It wasn't
pleasant.
Your page encoding in (X)HTML should be:
Your database tables should be converted to UTF-8 by doing an SQL dump and
then a search and replace for "CHARSET=latin1" with "CHARSET=utf8" and
change the "SET NAMES" directive to "utf8" from whatever it is now then
restore the database from your modified SQLDump.
The final link in the chain is the Database Connector. Not sure about the
PHP stuff but the Windows MySQL ODBC 3.51 driver keeps getting re-issued on
a bi-weekly basis, I think the current version is 20. Anyway, just make sure
you're using the latest and greatest.
There's lots of info out there telling you to do a "SET NAMES utf8" call to
the database on first connection, but I found that if you use the right
connector, there's no need to do it.
Good luck,
Craig
-----Original Message-----
Can anyone help?
I am having problems outputting chinese characters from a MySQL database.
I have set the encodong type on the database to
utf8_general_ci and the document encoding to utf-8
The characters display correctly in phpmyadmin but not when I try to output
them from a php page.
All I get is a ? for each character.
Any ideas.
Regards
Rob
|
 |
|