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

[PATCH 3/3] gitweb: Output valid utf8 in git_blame_common('data')

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 17, 2011, 09:22 UTC
Message-ID
<1324113743-21498-4-git-send-email-jnareb@gmail.com>
In-Reply-To
<1324113743-21498-1-git-send-email-jnareb@gmail.com>
From: Jürgen Kreileder <jk@blackdown.de>

Otherwise when javascript-actions are enabled gitweb shown broken author names in the tooltips on blame pages ('blame_incremental' view).

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index dcf4658..d24763b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6244,7 +6244,9 @@ sub git_blame_common {
 			-type=>"text/plain", -charset => "utf-8",
 			-status=> "200 OK");
 		local $| = 1; # output autoflush
-		print while <$fd>;
+		while (my $line = <$fd>) {
+			print to_utf8($line);
+		}
 		close $fd
 			or print "ERROR $!\n";
 
-- 
1.7.6
Previous: Jakub NarebskiNext: Junio C Hamano
Message 4 of 8 in “gitweb: Various to_utf8 / esc_html fixes”
  1. 0/3 gitweb: Various to_utf8 / esc_html fixesJakub Narebski, Dec 17, 2011
  2. 1/3 gitweb: Call to_utf8() on input string in chop_and_escape_str()Jakub Narebski, Dec 17, 2011
  3. 2/3 gitweb: esc_html() site name for title in OPMLJakub Narebski, Dec 17, 2011
  4. 3/3 gitweb: Output valid utf8 in git_blame_common('data')Jakub Narebski, Dec 17, 2011
  5. Junio C HamanoDec 17, 2011
  6. 4/3 gitweb: Fix fallback mode of to_utf8 subroutineJakub Narebski, Dec 19, 2011
  7. Jakub NarebskiDec 19, 2011
  8. 4/3 gitweb: Fix fallback mode of to_utf8 subroutineJakub Narebski, Dec 19, 2011

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.