websetup: Fix utf-8 problems.

master
Joey Hess 2010-01-09 16:20:09 -05:00
parent 6a0af02d3f
commit 59d929d6b1
3 changed files with 10 additions and 2 deletions

View File

@ -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});

1
debian/changelog vendored
View File

@ -6,6 +6,7 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low
are disabled.
* comments: Fix permalinks for comments using new conflict-free filenames.
* img: Support alignment of images with captions. (Giuseppe Bilotta)
* websetup: Fix utf-8 problems.
-- Joey Hess <joeyh@debian.org> Mon, 04 Jan 2010 12:53:24 -0500

View File

@ -4,6 +4,8 @@ I type chinese characters into the fields. After press "save setup" button the c
I submit a patch that solve the problem for me. --Lingo
> Fully fixing it is slightly more complex, but now [[done]] --[[Joey]]
----
--- websetup.pm 2009-12-02 05:07:46.000000000 +0800