My usual work flow is
I believe this is the only sane approach, otherwise you lose track which string is a text string and which is not.
The problems start when I put non-ASCII characters into the templates. I looked through the documentation of HTML::Template (I submitted a patch for this one), HTML::Template::Compiled (tinita says she's working on it), Template, Text::Template and Template::Simple, and none of them even mention encoding issues (I search for 'encoding', 'charset', 'utf8', 'utf-8' in the docs).
The problem is that when I write non-ASCII characters into the template files, and the template engine doesn't decode that into text strings and I supply text strings to populate the templates, I have mixed text and binary strings.
Now comes my question: Which template system provides sane handling of encodings? For me that's a good reason to switch to such a module.
My idea of "sane" is something along these lines: On opening the template files I can specify an encoding in which I want the file to be opened, and the template engine handles everything as text strings internally. Any other notion of what "sane" could mean is greatly appreciated as well.
Is this a cultural issue? I could imagine that people who's native language can fully be expressed in ASCII characters tend not to care too much about charset.
Grepping through the TT tarball from CPAN I found the note The ENCODING options needs testing and documenting. in the TODO file, so at least there is some awareness.
In reply to Handling Encoding in Templates by moritz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |