Catalyst + TT + Unicode in template + Unicode in YAML config + POST = double encoding

Thursday, 9 August 2007

Nerd warning

This very nice module, Catalyst::View::TT::ForceUTF8, is an add and forget for handling utf8 problems with Catalyst and Perl. But even with it as the base for your TT2 view, you will get double encoded utf8 in your web pages on POST if you have utf8 coming into your template from a YAML config file. To fix this simply “use” YAML::Syck in YourApp.pm. It understands how to properly bring in utf8 and the double encoding should disappear.

digg stumbleupon del.icio.us reddit Fark Technorati Faves
Your information (required) Name*
Email*
Website

* Indicates required fields; email is used for validation and is not displayed on the site.

Your comment
Commenting on Catalyst + TT + Unicode in template + Unicode in YAML config + POST = double encoding
Title

Body is limited to ≈1,000 words. Paragraphs—but not line breaks—are automatically inserted. Valid XHTML is required. These are the allowed tags–

<a href=""></a> <br/> <acronym title=""></acronym> <abbr title=""></abbr> <code></code> <pre></pre> <tt></tt> <ins></ins> <del></del> <hr/> <cite></cite> <b></b> <i></i> <sup></sup> <sub></sub> <strong></strong> <em></em> <h1></h1> <h2></h2> <h3></h3> <q></q> <blockquote></blockquote>