ldoozer Posted July 12, 2007 Share Posted July 12, 2007 I am using a template based site using php and on each page of my website the following characters  appear. This is one example of when i view the source: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I have searched through all my source code to check these character are not present so not sure how they are getting there... Any ideas anyone? Quote Link to comment Share on other sites More sharing options...
btherl Posted July 12, 2007 Share Posted July 12, 2007 Looks like a UTF8 byte order marker. What web server, OS (eg windows, linux) and which version of php are you using? And what browser are you browsing with? See here for details: http://msdn2.microsoft.com/en-us/library/ms776429.aspx Quote Link to comment Share on other sites More sharing options...
ldoozer Posted July 12, 2007 Author Share Posted July 12, 2007 Thanks for the reply. Linux PHP Version 4.4.1 Firefox Just noticed it doesn't appear in ie? Quote Link to comment Share on other sites More sharing options...
btherl Posted July 12, 2007 Share Posted July 12, 2007 I would guess that firefox strictly interprets your web server's declared character set, but IE recognizes the BOM and handles it. My gut feeling is that your webserver is set to add the UTF8 BOM to each page, but it declares the content-type as utf8 without BOM in the headers. I'm not sure of the details of fixing that. It's also possible PHP is adding it.. has your php installation been customized for anything to do with character sets? Quote Link to comment Share on other sites More sharing options...
ldoozer Posted July 12, 2007 Author Share Posted July 12, 2007 Not sure how the server is configured I'm afraid, its hosted at webfusion on a shared server. Thanks for the insight tho - i will do some googling for a fix. Cheers Steve Quote Link to comment Share on other sites More sharing options...
ldoozer Posted July 12, 2007 Author Share Posted July 12, 2007 just seen on my phpinfo.php page this - default_charset Local Value:no value Master value:no value does this help? Quote Link to comment Share on other sites More sharing options...
btherl Posted July 12, 2007 Share Posted July 12, 2007 Here's an idea .. install the "live http headers" firefox extension (google will find it for you) and see what it finds in the headers. It may even be setting them to iso-8859-1. You might be able to work around the problem by sending your own headers from php to override them, like header('Content-type: text/html; charset=UTF-8'); The other thing is to check any meta http-equiv tags that set charset. Quote Link to comment Share on other sites More sharing options...
ldoozer Posted July 12, 2007 Author Share Posted July 12, 2007 Thanks for your help. will try all those and post the solution when i come to it. Quote Link to comment Share on other sites More sharing options...
ldoozer Posted July 12, 2007 Author Share Posted July 12, 2007 Sorted it! It was as you said btherl, i just had to change the charset in my meta tag from this: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> to this: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.