git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: convert from perl internal to utf8 for commitdiff_plain
@ 2008-01-29  2:14 Yasushi SHOJI
  2008-01-29  3:11 ` Ismail Dönmez
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Yasushi SHOJI @ 2008-01-29  2:14 UTC (permalink / raw)
  To: git

commitdiff with raw, or plain format if you are reading the code,
doesn't convert any word from perl internal to utf8, which is set to
charset in http header.  this cause a problem when commit includes non
ascii code.

here is a few example in the git tree:

http://git.kernel.org/?p=git/git.git;a=commitdiff_plain;h=6ba78238a824282816944550edc4297dd2808a72
http://git.kernel.org/?p=git/git.git;a=commitdiff_plain;h=e360bebf713b6b03768c62de8b94ddf9350b0953
http://git.kernel.org/?p=git/git.git;a=commitdiff_plain;h=9459aa77a032621a29d53605542844641cca843a

This patch effectively revert the commitdiff plain part of the commit

	59b9f61a3f76762dc975e99cc05335a3b97ad1f9

which converted from print to here-doc. but it doesn't
explain why in the commit log.
---
 gitweb/gitweb.perl |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6256641..5d9ac1d 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5048,16 +5048,16 @@ 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: " . to_utf8($ad{'rfc2822'}) . " "
+			       . to_utf8($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";
 	}
-- 
1.5.4.rc5.1.g0d200

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-01-30  5:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29  2:14 [PATCH] gitweb: convert from perl internal to utf8 for commitdiff_plain Yasushi SHOJI
2008-01-29  3:11 ` Ismail Dönmez
2008-01-29  5:39 ` Junio C Hamano
2008-01-29  5:45   ` Yasushi SHOJI
2008-01-29  5:52     ` Junio C Hamano
2008-01-29 12:16       ` Yasushi SHOJI
2008-01-29 12:40         ` Jakub Narebski
2008-01-30  5:10         ` Junio C Hamano
2008-01-29 11:09 ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).