Skip Menu |

This queue is for tickets about the HTML-Template CPAN distribution.

Report information
The Basics
Id: 60366
Status: rejected
Priority: 0/
Queue: HTML-Template

People
Owner: Nobody in particular
Requestors: tlhackque [...] yahoo.com
Cc:
AdminCc:

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



Subject: Wishlist item: encode
I've started using HTML::Template to generate e-mail. (No, not spam - system management reports.) It would be nice to be able to specify encoding for a region; e.g. --Boundary Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!-- TMPL_ENCODE type="qp" --> Formatted plain text version of the report <!-- /TMPL_ENCODE --> --Boundary-- The semantics are that AFTER all the variable and loop expansion is complete, but before output the region between these tags is passed thru the specified encoding function. MIME::QuotedPrint provides the function to do this; base64 may be desired by folks who generate mail with lots of international characters. Of course, this can be done by post-processing the HTML::Template's output string - but that's less efficient. Some folks might also like the corresponding <TMPL_ESCAPE> so that one can write largeish blocks of text in templates without remembering to type &lt; instead of <... but that's just a note in passing.
I don't think this is something that should be in HTML::Template proper. Basically you're taking the scalar returned from the output() method and running some sort of filter on that. And in reality that output that is then filtered doesn't have any ties to HTML::Template itself. The only tie they seem to have is that you want to you the <tmpl_*> prefix for your tags. But if you pull this filtering out into it's own module, it could be useful for people who are using Template Toolkit, Template::Tiny, etc.