Jump to content

strabge characters appearing


ldoozer

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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" />

:)

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.