diff options
author | Yasushi SHOJI <yashi@atmark-techno.com> | 2008-01-29 21:16:02 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-01-29 21:23:57 -0800 |
commit | 7720224cebde08186627ab7bdb06018905d84e30 (patch) | |
tree | 0a6fe08e4eb5ab37d563eec2f7dcaeddd091071a /gitweb | |
parent | ab989adf6ab32fb80fd42cc95ed0eacb029258fe (diff) | |
download | git-7720224cebde08186627ab7bdb06018905d84e30.tar.gz |
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 <yashi@atmark-techno.com>
Acked-by: İsmail Dönmez <ismail@pardus.org.tr>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 11 |
1 files changed, 5 insertions, 6 deletions
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 <<TEXT; -From: $co{'author'} -Date: $ad{'rfc2822'} ($ad{'tz_local'}) -Subject: $co{'title'} -TEXT + print "From: " . to_utf8($co{'author'}) . "\n"; + print "Date: $ad{'rfc2822'} ($ad{'tz_local'})\n"; + print "Subject: " . to_utf8($co{'title'}) . "\n"; + print "X-Git-Tag: $tagname\n" if $tagname; print "X-Git-Url: " . $cgi->self_url() . "\n\n"; foreach my $line (@{$co{'comment'}}) { - print "$line\n"; + print to_utf8($line) . "\n"; } print "---\n\n"; } |