git: Fix malformed utf8 recieved from git.

If git log outputs malformed utf8 in, eg, usernames, detect it and fix it
up. This avoids commits such as f71abc92aa
breaking things.
master
Joey Hess 2009-01-25 23:13:14 -05:00
parent 51cd34afff
commit ce39f8e000
2 changed files with 7 additions and 0 deletions

View File

@ -139,6 +139,12 @@ sub safe_git (&@) {
my @lines;
while (<$OUT>) {
chomp;
# check for invalid utf-8, and toss it back to avoid crashes
if (! utf8::valid($_)) {
$_=encode_utf8($_);
}
push @lines, $_;
}

1
debian/changelog vendored
View File

@ -9,6 +9,7 @@ ikiwiki (3.03) UNRELEASED; urgency=low
* comments: If comment content checks fail, store the comment
(in .ikiwiki/comments_pending) for moderator review.
* comments: Add a moderation web interface.
* git: Fix malformed utf8 recieved from git.
-- Joey Hess <joeyh@debian.org> Sun, 18 Jan 2009 14:50:57 -0500