From: Yasushi SHOJI Date: Tue, 29 Jan 2008 12:16:02 +0000 (+0900) Subject: gitweb: Convert generated contents to utf8 in commitdiff_plain X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/60f6e4b1e963c274cdcd4062a6b384772bf586a36fda49e895490102bfc38269 gitweb: Convert generated contents to utf8 in commitdiff_plain If the commit message, or commit author contains non-ascii, it must be converted from Perl internal representation to utf-8, to follow what got declared in HTTP header. Use to_utf8() to do the conversion. This necessarily replaces here-doc with "print" statements. Signed-off-by: Yasushi SHOJI Acked-by: İsmail Dönmez Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index db3d749..134b39d 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -5049,16 +5049,15 @@ sub git_commitdiff { -expires => $expires, -content_disposition => 'inline; filename="' . "$filename" . '"'); my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'}); - print <self_url() . "\n\n"; foreach my $line (@{$co{'comment'}}) { - print "$line\n"; + print to_utf8($line) . "\n"; } print "---\n\n"; }