NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item11383 for general documentation changes for release 1.1.5. Use Item9693 for docu changes for release 2.0.

Item9227: viewfile defaults to charset ISO-8859-1 under CGI.pm

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine   Main.TimHeilig
-- 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

ItemTemplate edit

Summary viewfile defaults to charset ISO-8859-1 under CGI.pm
ReportedBy TimHeilig
Codebase 1.0.9, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor TimHeilig
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r4 - 09 Jul 2011 - 21:14:13 - TimHeilig
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads