git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: fix encode handling for site_{header,footer}
@ 2008-11-17  7:53 Tatsuki Sugiura
  2008-11-17 10:28 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Tatsuki Sugiura @ 2008-11-17  7:53 UTC (permalink / raw)
  To: git

All non-ASCII chars of site_{header,footer} will be broken
by perl IO layer without decoding to utf8.

Here is a fix to just call to_utf8 for inputs from these files.

Signed-off-by: Tatsuki Sugiura <sugi@nemui.org>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 933e137..79ca5c2 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2929,7 +2929,7 @@ EOF
 
 	if (-f $site_header) {
 		open (my $fd, $site_header);
-		print <$fd>;
+		print map {to_utf8($_)} <$fd>;
 		close $fd;
 	}
 
@@ -3018,7 +3018,7 @@ sub git_footer_html {
 
 	if (-f $site_footer) {
 		open (my $fd, $site_footer);
-		print <$fd>;
+		print map {to_utf8($_)} <$fd>;
 		close $fd;
 	}
 
-- 
1.5.6.5

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

end of thread, other threads:[~2008-12-08 17:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17  7:53 [PATCH] gitweb: fix encode handling for site_{header,footer} Tatsuki Sugiura
2008-11-17 10:28 ` Junio C Hamano
2008-11-17 10:40   ` Jakub Narebski
2008-12-01 18:01     ` [PATCH] gitweb: Fix handling of non-ASCII characters in inserted HTML files Jakub Narebski
2008-12-03  3:55       ` Junio C Hamano
2008-12-03 10:21         ` Jakub Narebski
2008-12-03 21:14           ` Junio C Hamano
2008-12-08 13:13             ` [PATCH] gitweb: Fix bug in insert_file() subroutine Jakub Narebski
2008-12-08 17:05               ` Junio C Hamano

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).