Skip Menu |
 

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 34876
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: cpan [...] wardley.org
Requestors: n [...] shaplov.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] FAQ.tt Problems with unicode
Download (untitled) / with headers
text/plain 308b
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
Download FAQ.tt2.diff
text/x-diff 651b
--- 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' }); +
Fixed in forthcoming 2.20


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.