Subject: | [PATCH] FAQ.tt Problems with unicode |
There is a common problem for users that want to use unicode
both in template text and in inserted data.
The solution of the broblem is not obvious, so I would offer to add
this issue to the FAQ. (FAQ patch is included, and should be
applied to
svn://svn.tt2.org/Template2/trunk/docsrc/src/FAQ/FAQ.tt2 )
Subject: | FAQ.tt2.diff |
--- FAQ.tt2.etalon 2008-03-25 19:00:51.000000000 +0300
+++ FAQ.tt2 2008-03-25 19:18:25.000000000 +0300
@@ -315,3 +315,15 @@
This illustrates the basic principal but you can extend it to perform
pretty much any kind of per-document initialisation that you require.
+=head1 Unicode issues
+
+=head2 Why do I get rubbish for my utf-8 templates?
+
+First of all, make sure that your template file have
+L<BOM|http://en.wikipedia.org/wiki/Byte_Order_Mark>.
+
+If you for some reason don't want to add BOM to your templates, you may
+force Template to use utf-8 encoding for your templates:
+
+ my $template = Template->new({ ENCODING => 'UTF-8' });
+