Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: PHP and Chinese Characters

date posted 12th October 2007 18:35

Thanks Craig,

Finally got it working by doing what you suggested.

With PHP you have to use the SET NAMES = utf8 because you are connecting
directly to the database and not using an ODBC driver or data source name.

Regards

Rob

----- Original Message -----
From: "Craig" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Friday, October 12, 2007 4:16 PM
Subject: RE: FN-FORUM: PHP and Chinese Characters


>
> 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: content="text/html; charset=UTF-8" />
> 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
>
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>



Messages by Day
October 31st 2007
October 30th 2007
October 29th 2007
October 28th 2007
October 27th 2007
October 26th 2007
October 25th 2007
October 24th 2007
October 23rd 2007
October 22nd 2007
October 21st 2007
October 20th 2007
October 19th 2007
October 18th 2007
October 17th 2007
October 16th 2007
October 15th 2007
October 14th 2007
October 13th 2007
October 12th 2007
October 11th 2007
October 10th 2007
October 9th 2007
October 8th 2007
October 7th 2007
October 6th 2007
October 5th 2007
October 4th 2007
October 3rd 2007
October 2nd 2007
October 1st 2007


Messages by Month
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000