On 10/10/2007, Chris G cl@isbd.net wrote:
On Tue, Oct 09, 2007 at 11:47:34PM +0100, Greg Thomas wrote:
On 09/10/2007, Chris G cl@isbd.net wrote:
So, how do I just get that directory hierarchy to be ISO-8859-1? I think part of my problem is that the files are not display directly but munged by a CGI script.
If it's a CGI script, just modify the CGI script to set the appropriate HTTP header.
... isn't this where we came in? :-)
The CGI (or HTML, or whatever) sets the header in the dynamically generated HTML to iso-8859-1 (I just checked and it does), but the apache server overrides that header with the line:-
AddDefaultCharset UTF-8
in the httpd.conf file. What I want to do is to change that UTF-8 back to is08859-1 for just the hierarchy of files used by my pyblosxom CGI script.
What you showed originally was the HTML setting the charset, with the line
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
This is embedded in the HTML, and overwritten by any content-type presented in the HTTP headers, which is completely different. The default HTTP content-type is set by Apache - UTF-8. However, if you get your CGI script to send an HTTP header (not an HTML header) that sets the content type explicitly, Apache shouldn't have the need to apply a default.
What is the CGI script written in? It probably has a line something like
print "Content-Type: text/html\n";
change that to
print "Content-Type: text/html; charset=iso-8859-1\n";
(if you using something like CGI.pm, it may be something like "print cgi->header" - in which case you'll need to set up the header).
Greg