From: Dan Scott Date: Sat, 10 Dec 2011 15:43:47 +0000 (-0500) Subject: TPAC: Assume that templates are encoded in UTF-8 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fdbs%2Ftpac_assume_utf8_templates;p=working%2FEvergreen.git TPAC: Assume that templates are encoded in UTF-8 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 --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 20a2e4df73..afc50dc91d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -35,6 +35,7 @@ sub handler { 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},