[Catalyst] TT and UNICODE: Garbled special characters
Bill Moseley
moseley at hank.org
Sat Sep 8 22:36:03 GMT 2007
On Sat, Sep 08, 2007 at 08:24:51PM +0200, Daniel McBrearty wrote:
> i don't know if this helps ... i had to dig around my code to find it,
> but I have this at the top of every template (actually at the top on
> an included template that they all use ...
>
> [% USE encoding 'utf-8' %]
>
> IIRC this ensures that the correct headers are sent out before the
> html.
No, I think that just says your template is utf8, and you must be
using Template::Provider::Encoding for that to work. If all your
templates are utf8 then you can just set the ENCODING option for TT.
View::TT:
ENCODING: UTF-8
Catalyst::View::TT will set the headers if not already set:
unless ( $c->response->content_type ) {
$c->response->content_type('text/html; charset=utf-8');
}
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list