X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=ebbd138c3eea30d3bccd809d6918d3ed72683527;hb=c733a6d618ff13765f3dd58911d164fca6431bf2;hp=41c4b773d8ca5d1586e9b4660ce7821019e2de16;hpb=d2278086877372c00bcefc607a4713d0fded4d53;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 41c4b77..ebbd138 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);
 }
@@ -717,7 +727,7 @@ not directly available via Catalyst objects $c->request, $c->engine ...
 
 BEWARE: If you really need to access some environment variable from your Catalyst
 application you should use $c->engine->env->{VARNAME} instead of $ENV{VARNAME},
-as in some enviroments the %ENV hash does not contain what you would expect.
+as in some environments the %ENV hash does not contain what you would expect.
 
 =head1 AUTHORS