I have this warning every time I run my CGI-script (output is rendered by Template::Toolkit):
Wide character in print at /usr/local/lib/perl5/site_perl/5.8.9/mach/Template.pm line 163.
What’s the right way to eliminate it?
I create the tt object using this config:
my %config = (
ENCODING => 'utf8',
INCLUDE_PATH => $ENV{TEMPLATES_DIR},
EVAL_PERL => 1,
}
my $tt = Template->new(\%config);
Put this before the call to
$tt->process()to have the output automatically encoded:Edit: As daxim mentioned, it’s possible to utilize TT’s encoding facilities:
This relies on the widely used convention that the
'-'filename gives youSTDINwhen it’s opened for reading, andSTDOUTwhen it’s opened for writing.Edit 2: BTW, the latter way doesn’t seem to work for me under mod_perl (2.0.5).