]> iEval git - plack-app-gruntmaster.git/commitdiff
Handle Unicode correctly
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 6 Feb 2014 12:38:47 +0000 (14:38 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 6 Feb 2014 12:38:47 +0000 (14:38 +0200)
lib/Gruntmaster/Page/Base.pm

index e8434ef5424cd6acda980ed1e9c11c0b5b7acc9a..cf29eacc3c56962148f012739c16bc36b0260aee 100644 (file)
@@ -4,7 +4,6 @@ use 5.014000;
 use strict;
 use warnings;
 
-use Encode qw/encode/;
 use File::Slurp qw/read_file/;
 use HTML::Template::Compiled;
 
@@ -146,7 +145,9 @@ sub generate{
 
        my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$self}{$lang}, default_escape => 'HTML',);
        $self->_generate($htc, $lang, @args);
-       [200, ['Content-Type' => 'text/html', 'Content-Language' => $_[1], 'Vary' => 'Accept-Language', 'X-Forever' => 1], [ encode 'UTF-8' => $htc->output ] ]
+       my $out = $htc->output;
+       utf8::downgrade($out);
+       [200, ['Content-Type' => 'text/html', 'Content-Language' => $_[1], 'Vary' => 'Accept-Language', 'X-Forever' => 1], [ $out ] ]
 }
 
 sub _generate {}
This page took 0.026959 seconds and 4 git commands to generate.