Hi,
I hope this is the right place to post...
I've been trying to fix some broken characters on my site. I've tracked the problem to the default encoding. I'm passing a meta tag as follows in the standard header in php for all my pages:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
I can verify that the browser is finding this and reports the meta tag correctly.
However on a couple of my pages, the http header is being changed from the default:
Content-Type: text/html
to
Content-Type: text/html; charset=UTF-8
I don't know where this is coming from! All the pages are generated the same way.
I've tried putting a php header directive into the two problem files before any text is output. The php manual says that the header entries will replaced if they already exist:
header("Content-Type:text/html; charset=ISO-8859-1");
But nothing happens. No replacement. I made sure the command was correct. I tried:
header("Crap:text/html; charset=ISO-8859-1");
I checked in the browser and the new Crap header entry was there.
The PHP Manual says you can opt to add rather than replace, if you pass false as the optional second argument. So I tried this expecting to see the problem UTF line followed by my new line:
header("Content-Type:text/html; charset=ISO-8859-1", 0);
But still, only the UTF-8 line makes the header entries.
I tried putting an entry into the .htaccess file:
<Files "problemFile.php">
ForceType 'text/html; charset=ISO-8859-1'
</Files>
but that just stuffed everything up. I don't think it got parsed as php then.
I tried creating a new file with a different name, and pasting the contents of the old file in. Same result. Which suggests that its somewhere in the contents of the file! But there is nothing that isn't in all the other files on my site. And they work don't have this problem.
I'm at my wits end!
Any help greatly appreciated.
PS - My site is one of a few on a Plesk server. I have root access to it.