Item9227: viewfile defaults to charset ISO-8859-1 under CGI.pm
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component:
Branches:
--
TimHeilig - 30 Jun 2010
Doesn't seem to be an issue with my current installation, feel free to close.
--
TimHeilig - 09 Jul 2011
When using CGI.pm as the engine (with or without mod-perl) If a user attaches an html file that is encoded in utf-8, and viewfile is used to retrieve the attachment, viewfile will set the content type to text/html ; charset= iso-8859-1.
This is because CGI.pm defaults charset to iso-8859-1 if it is not set. If instead the charset is set to '', then apache will return the correct charset. I don't know if this will work for other servers as well.
We don't allow CGI.pm to use the default charset, if
$Foswiki::cfg{CharSet}
is defined.
My understanding is that if the headers say one thing and the content of the HTML page another, then the HTML page will win out in the browser. As long as either (1) your fosiwki charset is set to UTF8 or (2) the HTML includes a META encoding, then everything should be all right.
Can you provide a testcase that suggests otherwise?
--
CrawfordCurrie - 08 Sep 2010