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 [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
