[Maypole] Unicode, CGI::Untaint, Class::DBI::FromCGI

Gaal Yahas gaal@forum2.org
Thu, 6 May 2004 13:57:20 +0300


On Thu, May 06, 2004 at 10:45:00AM +0100, Andrew Findlay wrote:
> # This directive specifies the name of the character set that will be
> # added to any response that does not have any parameter on the content
> # type in the HTTP headers. This will override any character set
> # specified in the body of the document via a META tag. A setting of
> # AddDefaultCharset Off disables this functionality. AddDefaultCharset
> # On enables Apache's internal default charset of iso-8859-1 as required
> # by the directive. You can also specify an alternate charset to be
> # used.
> 
> The key here is that the default will be added if no charset is
> defined *in the HTTP headers*. The presence of a META tag in the
> document has no effect.
> 
> It would be wise to make sure that a charset is specified either in
> the headers or in the page template for all pages. Maypole does this
> in the factory/header template.

I am aware of custom/header (factory/header does not provide this),
but Maypole *only* provides a META tag, which (contrary to the Apache
documentation you quote) *does* make its way to the HTTP response header!

In other words, Maypole does not fully control the HTTP headers (this is
no surprise). But if this is a *default* charset directive, why should
it override the META tag?  Are authors now supposed to set the response
headers outside their documents? The whole point of META tags is to save
them from doing that, hence my surprise. You know what, if this is the way
it's supposed to work, then Maypole is as good a place as any to centrally
configure this; perhaps we need an HTTP header template page as well.

-- 
Gaal Yahas <gaal@forum2.org>
http://gaal.livejournal.com/