]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/utf8_html_templates.mdwn
Manual install as plain user (only curl and build-essential required) on stable
[git.ikiwiki.info.git] / doc / bugs / utf8_html_templates.mdwn
1 HTML::Template does not read files as utf-8, so modifying ikiwiki's
2 template files to contain utf-8 won't currently work.
4 It seems that the best way to fix this would be to make HTML::Template
5 support utf-8.
7 A workaround is to change all the template reading code like this:
9         -     my $template=HTML::Template->new(blind_cache => 1,
10         -             filename => "$config{templatedir}/page.tmpl");
11         +     open(TMPL, "<:utf8", "$config{templatedir}/page.tmpl");
12         +     my $template=HTML::Template->new(filehandle => *TMPL);
13         +     close(TMPL);
15 However, this will make ikiwiki slower when rebuilding a wiki, since it
16 won't cache templates.
18 Could be approached by using HTML::Template's support for filters. Just make it use a filter that turns on utf-8
20 Or by subclassing it and overriding the \_init\_template method, though that's a bit uglier
22 [[bugs/done]]