Am 10.05.2010 um 21:36 schrieb Felipe Gasper (cPanel):
> How can I do this from perl:
>
> print "\x{201c}";
>
> ...in Template?
I don't know. But you could avoid having to do it by using a Unicode editor and
write the text as you want it to appear:
$ cat tt-utf8.pl
use strict;
use warnings;
use utf8; # source code in UTF-8
use Template;
binmode STDOUT, ':utf8'; # UTF-8 terminal
my $tmplfile = shift or die 'Vorlage!';
my %tmplvars = ( kk => 'Käsekuchen' );
my $tt2 = Template->new({ENCODING => 'UTF-8'}); # template in UTF-8
$tt2->process( $tmplfile, \%tmplvars ) or die $tt2->error;
$ cat kk.tt
Süß: [% kk %] ☺
$ perl tt-utf8.pl kk.tt
Süß: Käsekuchen ☺
--
Michael.Ludwig (#) XING.com
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates