From 5f1742e1556d3631fe797ee79137b706d8e1e9ee Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sat, 10 Dec 2011 10:43:47 -0500 Subject: [PATCH] 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 Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 1 + 1 file changed, 1 insertion(+) 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}, -- 2.11.0