[html-formfu] HTML::FormFu, YAML, Unicode issue (introduced December 2009)

Oskari 'Okko' Ojala okko+formfu at frantic.com
Mon Jan 4 13:36:32 GMT 2010


I updated my copy of HTML::FormFu and encoutered an issue where 
scandinavian letters in a YAML file got double-encoded in the output, 
inside Catalyst.


These lines have been removed from ObjectUtil.pm:

-    # ImplicitUnicode ensures that values won't be double-encoded when we
-    # encode() our output
-    local $YAML::Syck::ImplicitUnicode = 1;
-

with comment:

------------------------------------------------------------------------
r1640 | fireartist | 2009-12-09 13:29:00 +0200 (Wed, 09 Dec 2009) | 4 lines

change all uses of YAML::Syck to YAML::XS, as Config::Any now prefers that 
for YAML files.
checked that examples/unicode application still works as expected.
YAML::XS doesn't appear to need anything set to decode files as UTF8


In Makefile.PL the requires row is still:

requires 'Config::Any' => '0.10'; # supports multi-doc config files


The YAML::XS was added to the top of the YAML loaders list in Config::Any 
0.18 (see http://cpansearch.perl.org/src/BRICAS/Config-Any-0.18/Changes).

For people using Config::Any 0.17 the Unicode is thus broken. I think this 
should be fixed in FormFu by either putting those removed lines back or by 
requiring Config::Any version 0.18 in FormFu's Makefile.PL.


For users the fix is simple: Update Config::Any to at least 0.18 when 
updating HTML::FormFu.

-- 
Oskari "Okko" Ojala



More information about the HTML-FormFu mailing list