diff options
-rw-r--r-- | IkiWiki/Plugin/404.pm | 3 | ||||
-rw-r--r-- | IkiWiki/Plugin/git.pm | 14 | ||||
-rw-r--r-- | debian/changelog | 8 |
3 files changed, 18 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/404.pm b/IkiWiki/Plugin/404.pm index 5550ea7d1..bae9e15d1 100644 --- a/IkiWiki/Plugin/404.pm +++ b/IkiWiki/Plugin/404.pm @@ -67,7 +67,8 @@ sub cgi_page_from_404 ($$$) { sub cgi ($) { my $cgi=shift; - if ($ENV{REDIRECT_STATUS} eq '404') { + if (exists $ENV{REDIRECT_STATUS} && + $ENV{REDIRECT_STATUS} eq '404') { my $page = cgi_page_from_404($ENV{REDIRECT_URL}, $config{url}, $config{usedirs}); IkiWiki::Plugin::goto::cgi_goto($cgi, $page); diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 042c69f5a..b386ab71b 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -136,14 +136,16 @@ sub safe_git (&@) { } # In parent. + # git output is probably utf-8 encoded, but may contain + # other encodings or invalidly encoded stuff. So do not rely + # on the normal utf-8 IO layer, decode it by hand. + binmode($OUT); + my @lines; while (<$OUT>) { + $_=decode_utf8($_, 0); + chomp; - - # check for invalid utf-8, and toss it back to avoid crashes - if (! utf8::valid($_)) { - $_=encode_utf8($_); - } push @lines, $_; } @@ -447,7 +449,7 @@ sub rcs_commit_staged ($$$) { # Set the commit author and email to the web committer. my %env=%ENV; if (defined $user || defined $ipaddr) { - my $u=defined $user ? $user : $ipaddr; + my $u=encode_utf8(defined $user ? $user : $ipaddr); $ENV{GIT_AUTHOR_NAME}=$u; $ENV{GIT_AUTHOR_EMAIL}="$u\@web"; } diff --git a/debian/changelog b/debian/changelog index c66db85a2..77b5d9fa6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ikiwiki (3.08) UNRELEASED; urgency=low + + * git: Fix utf-8 encoding of author names. + * git: Manually decode git output from utf-8, avoids + warning messages on invalidly encoded output. + + -- Joey Hess <joeyh@debian.org> Mon, 09 Mar 2009 14:00:21 -0400 + ikiwiki (3.07) unstable; urgency=low * Updated German translation (Kai Wasserbäch). Closes: #518377 |