On Tue, Oct 09, 2007 at 06:40:47PM +0100, Chris G wrote:
On Tue, Oct 09, 2007 at 05:39:30PM +0100, MJ Ray wrote:
Chris G cl@isbd.net wrote:
On Tue, Oct 09, 2007 at 03:05:20PM +0100, MJ Ray wrote:
Check the HTTP header (curl -I or wget --head) of the URL. The HTTP header and XML opening both trump the http-equiv meta, as described in http://www.w3.org/International/O-charset#declaring with links to how to correct things.
OK, thanks, that *explains* it then:-
[...]
However, how do I get a file which has some ISO-8859-1 encodings in it to be transmitted correctly by the web server?
Follow the links from that URL to how to correct things. In this case, you want "Setting the HTTP charset parameter" which includes:
"Apache. This can be done via the AddCharset (Apache 1.3.10 and later) or AddType directives, for directories or individual resources (files). With AddDefaultCharset (Apache 1.3.12 and later), it is possible to set the default 'charset' for a whole server. For more information, see the article on Setting 'charset' information in .htaccess."
Excellent, thank you very much!
... and I now sort of hav it working but it has raised another question - how do you specify an apache directive for a dynamic file?
The example in question is the reStructuredText file:-
/home/chris/webdev/info/computer/internet/history/micromedia.rst
This gets displayed in the browser using the URL:-
http://home.isbd.net/cgi-bin/pyblosxom.cgi/wiki/computer/internet/history/mi...
I can get the GBP signs to display correctly if I remove the "AddDefaultCharset UTF-8" from my global httpd.conf file so that it reverts to the default of ISO-8859-1. However I'd really prefer to keep the default Charset as UTF-8 and change it to ISO-8859-1 for just the /home/chris/webdev/info hierarchy.
But how do I do it? Adding a .htaccess file with "AddCharset ISO-8859-1 .rst .txtl" to the directory /home/chris/webdev/info doesn't seem to do anything, but that doesn't surprise me really because I don't think my browser ever sees that .rst file. I also tried:-
<Directory /var/www/cgi-bin/pyblosxom.cgi> AddCharset ISO-8859-1 .rst .txtl AddDefaultCharset ISO-8859-1 </Directory>
at the bottom of the global httpd.conf file but that didn't work either. (... and yes, I did restart apache)
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.