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-Tag: v1.5.4~15 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7720224cebde08186627ab7bdb06018905d84e30 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/gitweb.perl b/gitweb/gitweb.perl index 6256641ace..80e3d0ac47 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5048,16 +5048,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"; }