X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=e770f325fb97fd8ade0cbe9ecd6dbd4ec8af6260;hb=a84683240a2c46b54f93e15b23b479f5f652f92f;hp=41c4b773d8ca5d1586e9b4660ce7821019e2de16;hpb=d2278086877372c00bcefc607a4713d0fded4d53;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 41c4b77..e770f32 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -10,6 +10,8 @@ use HTML::Entities; use HTTP::Body; use HTTP::Headers; use URI::QueryParam; +use Encode (); +use utf8; use namespace::clean -except => 'meta'; @@ -131,6 +133,14 @@ sub finalize_error { $c->res->content_type('text/html; charset=utf-8'); my $name = ref($c)->config->{name} || join(' ', split('::', ref $c)); + + # Prevent Catalyst::Plugin::Unicode::Encoding from running. + # This is a little nasty, but it's the best way to be clean whether or + # not the user has an encoding plugin. + + if ($c->can('encoding')) { + $c->{encoding} = ''; + } my ( $title, $error, $infos ); if ( $c->debug ) { @@ -166,7 +176,6 @@ sub finalize_error { $error = ''; $infos = <<"";
-(es) Por favor inténtelo de nuevo más tarde
 (en) Please come back later
 (fr) SVP veuillez revenir plus tard
 (de) Bitte versuchen sie es spaeter nocheinmal
@@ -280,11 +289,12 @@ sub finalize_error {
 
 
 
-
     # Trick IE. Old versions of IE would display their own error page instead
     # of ours if we'd give it less than 512 bytes.
     $c->res->{body} .= ( ' ' x 512 );
 
+    $c->res->{body} = Encode::encode("UTF-8", $c->res->{body});
+
     # Return 500
     $c->res->status(500);
 }