Code

gitweb: Output valid utf8 in git_blame_common('data')
authorJürgen Kreileder <jk@blackdown.de>
Sat, 17 Dec 2011 09:22:23 +0000 (10:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Dec 2011 03:44:52 +0000 (19:44 -0800)
Otherwise when javascript-actions are enabled gitweb shown broken
author names in the tooltips on blame pages ('blame_incremental'
view).

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl

index a9f39d59cdaec0880106cbdd03f4011d034d9de8..dc2ad9d4a4d9c56c78cb73a31492bf93be93141f 100755 (executable)
@@ -6108,7 +6108,9 @@ sub git_blame_common {
                        -type=>"text/plain", -charset => "utf-8",
                        -status=> "200 OK");
                local $| = 1; # output autoflush
-               print while <$fd>;
+               while (my $line = <$fd>) {
+                       print to_utf8($line);
+               }
                close $fd
                        or print "ERROR $!\n";