From 59d929d6b1271c84c6d17ffbff65b57bf67d49e6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Jan 2010 16:20:09 -0500 Subject: websetup: Fix utf-8 problems. --- IkiWiki/Plugin/websetup.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 9edd22d26..75aa3681c 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -139,7 +139,11 @@ sub showfields ($$$@) { my $value=$config{$key}; if ($info{safe} && (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { - $value=[(ref $value eq 'ARRAY' ? @{$value} : ""), "", ""]; # blank items for expansion + $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) } @{$value} : ""), + "", ""]; # blank items for expansion + } + else { + $value=Encode::encode_utf8($value); } if ($info{type} eq "string") { @@ -290,7 +294,6 @@ sub showform ($$) { shift->(form => $form, cgi => $cgi, session => $session, buttons => $buttons); }); - IkiWiki::decode_form_utf8($form); my %fields=showfields($form, undef, undef, IkiWiki::getsetup()); @@ -308,6 +311,8 @@ sub showform ($$) { $fields{$_}=$shown{$_} foreach keys %shown; } } + + IkiWiki::decode_form_utf8($form); if ($form->submitted eq "Cancel") { IkiWiki::redirect($cgi, $config{url}); -- cgit v1.2.3