git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
TSTatsuki Sugiura <sugi@nemui.org>
Date
Nov 17, 2008, 07:53 UTC
Message-ID
<87vdumbxgc.wl@vaj-k-334-sugi.local.valinux.co.jp>

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
Next: Junio C Hamano
Message 1 of 9 in “gitweb: fix encode handling for site_{header,footer}”
  1. gitweb: fix encode handling for site_{header,footer}Tatsuki Sugiura, Nov 17, 2008
  2. Junio C HamanoNov 17, 2008
  3. Jakub NarebskiNov 17, 2008
  4. gitweb: Fix handling of non-ASCII characters in inserted HTML filesJakub Narebski, Dec 1, 2008
  5. Junio C HamanoDec 3, 2008
  6. Jakub NarebskiDec 3, 2008
  7. Junio C HamanoDec 3, 2008
  8. gitweb: Fix bug in insert_file() subroutineJakub Narebski, Dec 8, 2008
  9. Junio C HamanoDec 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.