From 927cd1fc940f7b588521b388aeb610ab3890399e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BF=A0=E5=B1=B1?= Date: Thu, 4 Aug 2011 23:52:55 +0800 Subject: [PATCH] gitweb: pass string after encoding in utf-8 to syntax highlighter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise the highlight filter would work on a corrupt byte sequence. Signed-off-by: 张忠山 Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index dab89f2eb0..48def3841f 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -6465,7 +6465,7 @@ sub git_blob { $nr++; $line = untabify($line); printf qq!
%4i %s
\n!, - $nr, esc_attr(href(-replay => 1)), $nr, $nr, $syntax ? $line : esc_html($line, -nbsp=>1); + $nr, esc_attr(href(-replay => 1)), $nr, $nr, $syntax ? to_utf8($line) : esc_html($line, -nbsp=>1); } } close $fd