Per http://template-toolkit.org/docs/faq/index.html
under "Why do I get rubbish for my utf-8 templates?", Template::Toolkit
does not assume that templates are encoded in UTF-8, which runs counter
to current assumptions circa 2011.
Practically, this means that before this change any UTF8 characters
used for purposes such as Unicode art or otherwise would be garbled in
the generated Web page. This commit tells Template::Toolkit to assume
that the templates are UTF8 without forcing us to monkey with byte-order
markers.
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
my $text_handler = set_text_handler($ctx, $r);
my $tt = Template->new({
+ ENCODING => 'utf-8',
OUTPUT => ($as_xml) ? sub { parse_as_xml($r, $ctx, @_); } : $r,
INCLUDE_PATH => $ctx->{template_paths},
DEBUG => $ctx->{debug_template},