set encoding & charset before processing view
get encoding from application in header.
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@202
48953598-375a-da11-a14b-
00016c27c3ee
package Maypole;
-use base qw(Class::Accessor::FAST Class::Data::Inheritable);
+use base qw(Class::Accessor::Fast Class::Data::Inheritable);
use attributes ();
use UNIVERSAL::require;
use strict;
if ( my $error = $@ ) {
$status = $r->call_exception($error);
if ( $status != OK ) {
- warn "caught view error: $error";
+ warn "caught view error: $error" if $r->debug;
return $r->debug ? $r->view_object->error( $r, $error ) : ERROR;
}
}
sub process {
my ( $self, $r ) = @_;
- my $status = $self->template($r);
- return $self->error($r) if $status != OK;
$r->{content_type} ||= "text/html";
$r->{document_encoding} ||= "utf-8";
+ my $status = $self->template($r);
+ return $self->error($r) if $status != OK;
return OK;
}
"A poorly configured Maypole application"
%]
</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=[%
+ request.document_encoding
+ %]"/>
<link title="Maypole" href="/maypole.css" type="text/css"
rel="stylesheet"/>
</head>