Re: [Templates] Template::Plugin::MapUTF8 - wrapper around Unicode::MapUTF8.

[prev] [thread] [next] [Date index for 2004/12/21]

From: Tom Insam
Subject: Re: [Templates] Template::Plugin::MapUTF8 - wrapper around Unicode::MapUTF8.
Date: 10:37 on 21 Dec 2004
On Dec 21, 2004, at 9:49, Tatsuhiko Miyagawa wrote:
>
> Looking through Template.pm shows that "binmode" option works only when
> you dump the template output to files (sub _output). So when you want 
> to
> convert the output into some native encodings without dumping to a
> temporary file (i.e. print it to scalar or filehandle), you still have
> to do it manually or to setup PerlIO layer before process().

Assuming that everything you feed to TT is a native perl string, then 
running process() with a scalarref as the output object (so the output 
goes into the scalar) will give you an output scalar that is a real 
perl string as well. You only ever need to care about native encodings 
when displaying the output, hence the binmode on the process-to-file 
command. If you want to display the scalar your way, then yes, you'll 
need to handle converting it to a byte encoding manually.


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] Template::Plugin::MapUTF8 - wrapper around Unicode::MapUTF8.
Tom Insam 10:37 on 21 Dec 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52