Hi again, I also noticed a mojibake issue: a git diff that contains UTF-8 is double-encoded (converted to UTF-8 as if it were latin1 or something, even if it was already UTF-8), and this seems to be independent of the locale. I *think* using the to_utf8 sub on the content is the right fix, as it seems to check if it’s UTF-8, pass through if it is, and encode to UTF-8 (which the HTTP headers say is sent) if it’s not. Patch which fixes this, for commitdiff_plain and patch for me: diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index b5490dfecf..434b1c01cd 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -8063,12 +8063,12 @@ sub git_commitdiff { } elsif ($format eq 'plain') { local $/ = undef; - print <$fd>; + print to_utf8(<$fd>); close $fd or print "Reading git-diff-tree failed\n"; } elsif ($format eq 'patch') { local $/ = undef; - print <$fd>; + print to_utf8(<$fd>); close $fd or print "Reading git-format-patch failed\n"; } This might probably need fixing in more places. While scrolling, I saw blobdiff; I have not identified all places needed and would appreciate the maintainer on your side doing so and fixing them. Thanks in advance, //mirabilos -- I believe no one can invent an algorithm. One just happens to hit upon it when God enlightens him. Or only God invents algorithms, we merely copy them. If you don't believe in God, just consider God as Nature if you won't deny existence. -- Coywolf Qi Hunt