Using Template Toolkit and UTF-8

Andy Wardley abw at wardley.org
Thu Jan 19 07:57:46 GMT 2006


Steve Sims wrote:
> The problem I have is that the processed templates that I cache to  
> files aren't being treated as UTF-8 by Template Toolkit.  They don't  
> get created with a UTF-8 BOM.  As a result I get pages where the  
> stuff created on the fly by Template Toolkit is all nicely UTF-8, but  
> the cached bits are garbage. :-(

I'm not sure what you mean when you talk about cached templates.
If you mean templates compiled to disk by TT (e.g. by setting the 
COMPILE_DIR / COMPILE_EXT options) then they should work fine with
UTF8 (and do, to the best of my knowledge).

Or is this some additional caching step that you're implementing 
yourself?

The TT mailing list might be a better place to ask.  The UTF8 issue has
come up a few times.

http://template-toolkit.org/pipermail/templates/2005-July/007532.html
http://template-toolkit.org/pipermail/templates/2004-June/006270.html

Cheers
A



More information about the london.pm mailing list