From 1053baeebc541fc3508aabb6121759bb4a884e23 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 6 Feb 2014 14:38:47 +0200 Subject: [PATCH] Handle Unicode correctly --- lib/Gruntmaster/Page/Base.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 {} -- 2.39.2