[Catalyst] Re: Catalyst, utf8 in form element type text - Solved

Bill Moseley moseley at hank.org
Mon May 5 19:28:59 BST 2008


On Mon, May 05, 2008 at 04:12:53PM +0200, Marius Kjeldahl wrote:
> Problem solved. In my "View" class, like:
> 
> package MyApp::View::TT;
> use strict; use warnings;
> use base 'Catalyst::View::TT';
> 
> replace the last line with:
> 
> use base 'Catalyst::View::TT::ForceUTF8';

That seems like the wrong approach.

Data should be decoded on input from the outside and encoded on
output.  I'm not sure when it would be advisable to force utf8 flag
on items in the stash, but I have not looked at that module in a
while.

<form> tags should have accept-charset

C::P::Unicode::Encoding should be used (I suggest with reservations).
That will decode parameters and encoding output.

If your templates are UTF8 then ENCODING => 'UTF-8' when creating TT
object.

Do what's required for your database to handle utf-8.

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list