From: Marius Gavrilescu Date: Thu, 6 Feb 2014 12:38:47 +0000 (+0200) Subject: Handle Unicode correctly X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=1053baeebc541fc3508aabb6121759bb4a884e23;p=gruntmaster-page.git Handle Unicode correctly --- diff --git a/lib/Gruntmaster/Page/Base.pm b/lib/Gruntmaster/Page/Base.pm index e8434ef..cf29eac 100644 --- a/lib/Gruntmaster/Page/Base.pm +++ b/lib/Gruntmaster/Page/Base.pm @@ -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 {}