Foreign Characters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Foreign Characters

Post by aceconcepts »

Hi,

I have a user of my system in China and they have recorded some details and they appear as Chinese characters.

Is there a way I can encode/decode the characters?

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Foreign Characters

Post by Christopher »

Could you clarify what "my system" and "have recorded some details" mean? I assume you mean they have used your website and the website has save some input into a database...
(#10850)
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Foreign Characters

Post by aceconcepts »

Certainly,

my system is basically a registration process built using PHP and MySQL as a database.

When a "registrant" enters their details - name, address etc... their details are then inserted into the necessary MySQL database tables.

All tables are encoded as UTF-8.

I hope this give sufficient insight.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Foreign Characters

Post by Christopher »

What character set do you specify in the HTML header for your pages?
(#10850)
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Foreign Characters

Post by aceconcepts »

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Foreign Characters

Post by aceconcepts »

Can anyone help?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Foreign Characters

Post by Christopher »

So your database is set to UTF-8 and your page is displaying UTF-8, that means that the characters are a different character set. Do you have a guess what character set they use?
(#10850)
Post Reply