[html-formfu] catalyst, formfu and unicode

Carl Franks fireartist at gmail.com
Thu Sep 27 18:53:43 GMT 2007


On 27/09/2007, Josef Chladek <josef.chladek at gmail.com> wrote:
> 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)

I've had a look at the Cat app you sent - and I've managed to get it
working properly.

* Load Catalyst::Plugin::Unicode.

* Add the config option (ENCODING => 'UTF-8') to View/TT.
(DEFAULT_ENCODING is a View/TT/ForceUTF8 option - which shouldn't be necessary)

* Finally, the main thing that was causing problems was the lang="de"
attribute in the html tag in your foo.tt2 - remove it.

You should now find that form submissions with errors render ok.
I've also tested this with Compress::Gzip - and it works fine too.

If you find yourself having to remove Catalyst::Plugin::UTF8 or remove
"use utf8" from modules with utf8 in the source - then there's
something else going wrong.

To be honest, I don't know why the lang tag caused problems - I've
never used lang tags, and I also only use xhtml, not html.
I tried adding a meta tag with a lang="de" attribute, and it didn't
cause any problems, but I don't know if that has the same effect that
you're wanting.

Carl



More information about the HTML-FormFu mailing list