DORMANTno replies

[PATCH] gitweb: fix encode handling for site_{header,footer}

From: Tatsuki Sugiura <hidden>
Date: 2016-06-15 22:45:40
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help