On 10/10/2007, Greg Thomas Greg@thethomashome.co.uk wrote:
On 10/10/2007, Chris G cl@isbd.net wrote:
On Wed, Oct 10, 2007 at 09:11:37AM +0100, Greg Thomas wrote:
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.
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";
There's a line in the config file:-
py["locale"] = "en_US.iso-8859-1"
... and there's also:-
py["blog_encoding"] = "iso-8859-1"
... but the output from the browser is still obstinately defaulted to UTF-8.
Is there a way you can examine the headers that the CGI script is presenting without Apache getting in the way - with Perl you could just run the script from the command line, and it would send the output to stdout. Check and see if there is a content-type header specifying the right charset. I suspect not. Googling turns up http://www.python.org/doc/current/lib/cgi-intro.html which suggests that the header is output explicitly ('print "Content-Type: text/html"').
I use pyblosxom too and the issue there is that it's not just the one script for me; it's a whole series of python files and the content-type header is outputted in a dynamic way, i.e. there's no obvious place you can add in the encoding to the end of the header line. I tested with wget and my installation also seems to be sending charset=UTF-8 despite the pyblosxom config saying py["blog_encoding"] = "iso-8859-1".
Either pyblosxom is ignoring it or it's not sending one at all and Apache is jumping in with the default charset. Perhaps pyblosxom needs some hacking to send the right headers.
I tried to run it from the command line, but the script is too clever: when it runs from the command line, it goes into an "installation verification system" where it checks it's installed correctly. It only outputs HTML when run as a cgi from what I can tell.
Ross