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

Owner: cpan [...]
Requestors: n [...]

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

Subject: [PATCH] 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:// )
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|>. + +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 infrastructure.

Please report any issues with to