[html-formfu] catalyst, formfu and unicode

Josef Chladek josef.chladek at gmail.com
Tue Oct 16 19:38:25 GMT 2007


Am 27.09.2007 um 16:58 schrieb Josef Chladek:

> hello list,
>
> after endless hours of debugging, here are my recommendations for  
> correct use of utf8 with Catalyst and HTML::FormFu
>
> 1) don't use Catalyst::Plugin::Unicode
> 2) don't use "use utf8" in the controller, that has formfu stuff in it
> 3) don't use .yml configs, use Config::General instead (maybe  
> others working as well)
> 4) in I18/de.pm remove "use utf8", otherwise error-messages corrupt  
> the rest of the page
>
> at least for me now everything is encoded correctly (and my other  
> controllers work as well correctly with utf8)
>
> C:P:Compress:Gzip is ok to use (contrary to what I said yesterday)

meanwhile I've a clean running app, please ignore my post above, the  
reason everything was screwed up was a mix of switching between perl  
5.8 and 5.9, using DBIC without uf8_columns and TT caching templates:

1) USE Catalyst::Plugin::Unicode
2) use utf8 whenever you have utf8 chars in your source
3) yml configs don't have todo anything with this at all
4) leave I18/de.pm as is
5) whenever using DBIC with utf8 cols in the DB use  
DBIx::Class::UTF8Columns - this was my major problem, data looked  
like utf8 but was not internally
6) DON'T use C:P:Compress:Gzip in perl 5.9 - it will screw up the  
utf8 output
7) use ENCODING => 'UTF-8' in your View::TT

all my problems had nothing todo with formfu!
it cost a lot of debugging time but now we don't have encoding  
problems anymore.

on more tip: when changing something in your cat-controller (or the  
DBIC classes) while debugging, it helps to touch your .tt file(s), so  
it/they will be regenerated with the data from controller/db and not  
the cached/compiled version will be taken!
there is only a small problem: if you "insert" a tt-file with utf8 in  
another tt file, utf8 is broken, if you "include" it, it works - see  
the following thread

http://lists.scsys.co.uk/pipermail/catalyst/2007-October/015484.html

but once you know that, you can live with it...
josef





More information about the HTML-FormFu mailing list