You should really be setting your character set in an htaccess file or in Apache directly.
The reason for that is, what character encoding does the document have before it reaches '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'?
Also, if you transport the document somewhere and want to change character sets, you just change one file for all documents.
you can follow nick1presta comment. He shows you right direction.
HTTP charset: Mozilla supports server-generated HTTP charset correctly. (The order of priority is: HTTP charset > Document Meta Charset > Browser Menu choice.) However, if you’re going to say you’re using XHTML, then please make sure you use it properly. This is where most people and browsers fall down.
Setting Mimetype application/xhtml+xml headers in PHP ============================================ In some special cases, before sending HTML META Tags header you need to send HTTP Header first. Something like this:
<?php include('header.php');// contains the above function set_header(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>.... etc
I am not going to rewrite/duplicate the code which is already written by someone else. Please refer this, this is going to help you out and solve your charset issues.:
Try an XML processing instruction: <?xml version="1.0" charset="UTF-8"?>
While that's totally valid, it also sends some versions of IE into quirks mode and hoses the box model (as does any code or comment before the DOCTYPE declaration).
(Also, depending on how PHP may be configured that could trigger the PHP parser into thinking it's a command and throwing PHP errors.)
Including it in IE causes problems there. Excluding it anywhere else does no harm. Whatever decision you choose to make based on that is up to you and pretty much purely a matter of personal preference (at least for now).
Yeah, I've excluded it from IE. I'm pretty content with my coding now. I need to condense and fix my css, tidy it up... and get it to work correctly in IE. If anyone is willing to help me out, that'd be great ;)