aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-07-02 18:16:44 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-07-02 18:16:44 +0000
commit0e1bfa69a0ffeeb47fae140b5368254f0437b25b (patch)
treee61a78a4b1be0075d09175ec5767b84b4a8950fc
parentcacc2cefa7e6e4ca6d75f015ed353dd54e4a0f33 (diff)
downloadikiwiki-0e1bfa69a0ffeeb47fae140b5368254f0437b25b.tar
ikiwiki-0e1bfa69a0ffeeb47fae140b5368254f0437b25b.tar.gz
new approach for forcing utf8 -- use a HTML::Template filter
-rw-r--r--IkiWiki/CGI.pm9
1 files changed, 3 insertions, 6 deletions
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(),