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

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.