Jump to content

Guide to Character Encoding in HTML / PHP / MySQL ???


jggretton

Recommended Posts

Hi all, I'm a reasonably experienced PHP developer however I keep on getting caught short by character encoding problems - e acutes in xml, pound signs from WYSIWYG editors, Mac characters Vs PC characters etc etc...

 

I was hoping that someone might know of a good online guide (or book if necessary) which can teach me the basics and build up from there?

 

I've spent a few hours doing Google searches but haven't found anything that clearly covers everything i need.

 

Any recommendations would be greatly appreciated.

 

Many thanks,

 

James

Hello, in case anyone else comes across this question themselves, I did find a very useful article here:

 

http://www.sitepoint.com/article/guide-web-character-encoding/

Backed up by a forum post here: http://www.sitepoint.com/forums/showthread.php?t=450442&page=1 (ignore the comments by the ranting bloke though)

 

Any other good articles would be appreciated!

 

Thanks,

 

James

 

 

I just use utf-8 everywhere, so my checklist is as follows

 

1. Database tables

2. PHP sources

3. HTTP headers

4. HTML encoding declarations

5. PHP - MySQL connection

6. XML files (these should always be utf-8 as per standard)

 

I just make sure all of these are utf-8 and things work.

Ah, thanks Mchl. That's certainly the stage I've now got to - make it UTF-8 and stop worrying about it!

 

You have pointed out one bit which I previously missed (which is very important): Point 5. PHP - MySQL connection. I will have a play with this now.

 

Thanks for your help,

 

James 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.