
mariusauto-catalyst at kjeldahl
May 5, 2008, 12:22 PM
Post #5 of 8
(277 views)
Permalink
|
|
Re: Re: Catalyst, utf8 in form element type text - Solved
[In reply to]
|
|
Bill Moseley wrote: >> 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 I tried this but couldn't get it working correctly, which may be entirely my fault of course. > C::P::Unicode::Encoding should be used (I suggest with reservations). > That will decode parameters and encoding output. I looked into this and related modules trying to figure out exactly where to do what, which lead me to the solution posted. > If your templates are UTF8 then ENCODING => 'UTF-8' when creating TT > object. Tried this as well. Didn't work. As far as I managed to figure out, that solution requires the plugin you mentioned, or a similar one (possibly ending in Encode instead of Encoding - I'm taking this from memory while googling for a solution to my problem). > Do what's required for your database to handle utf-8. In my case, everything is utf8. The source code (with embedded strings), the database and I see no reason to start juggling back and forth between encodings unless there is a specific need. There may be one, which I'm sure further testing will demonstrate, but for now I'm ok. Actually, I found one place where it was actually needed already. I'm using some of the Yahoo YUI "ajax" components which didn't work great with utf8, and a simple "decode" (from utf8) before returning some values in a ajax component seemed to solve it just. There may be flags that can be set in the YUI library which enable utf8 encoding also, which would probably be a better solution. Thanks, Marius K. _______________________________________________ List: Catalyst[at]lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
|