From: joey Date: Sun, 2 Jul 2006 18:16:44 +0000 (+0000) Subject: new approach for forcing utf8 -- use a HTML::Template filter X-Git-Tag: 1.8~39 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e1bfa69a0ffeeb47fae140b5368254f0437b25b;p=ikiwiki.git new approach for forcing utf8 -- use a HTML::Template filter --- diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index d9c9fe828..e02ab62a6 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -35,12 +35,9 @@ sub cgi_recentchanges ($) { #{{{ # Force reading the template as utf-8, necessary if # rcs_recentchanges returns true utf-8 strings. - open(TMPL, "<:utf8", "$config{templatedir}/recentchanges.tmpl"); - my $template=HTML::Template->new(filehandle => *TMPL); - close(TMPL); - my $template=HTML::Template->new( - filename => "$config{templatedir}/recentchanges.tmpl" - ); + require Encode; + my $template=HTML::Template->new(filter => \&Encode::decode_utf8, + filename => "$config{templatedir}/recentchanges.tmpl"); $template->param( title => "RecentChanges", indexlink => indexlink(),