Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

dws (341)

  (email not shown publicly)

Journal of dws (341)

Saturday October 16, 2004
11:48 PM

HTML::Template and HTML::Entities

[ #21382 ]

Faced with many tens of templates that suddenly needed to accomodate text with diacriticals (i.e., the unsafe half of iso-8859-1), rather than tracking down the hundreds of places we stuff text into template parameters and rewire them to use HTML::Entities to encode the text, I modified HTML::Template to optionally use HTML::Entities to escape text. We were already using ESCAPE=HTML in the templates, so this seemed like the "easist thing that could possibly work" approach. In fact, it all took all of about a dozen lines of code to get Latin1 support in our app. The performance hit, at least as judged by timing our unit tests, is negligable.

And now the question: I'm sure this idea has come up before, and that there's probably been some discussion about it. Have I stepped into the losing side of an old argument by taking this approach, or would it be reasonable to submit the changes as a patch?

(Updated to add: The patch for adding this to HTML::Template 2.7 is here.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.