From: zzs Date: Thu, 04 Aug 2011 05:31:23 GMT Subject: gitweb highligh generate illegal char when the content had utf-8 chars Message-ID: <20110804053123.GA13198@greatfirst.com> When my C file had some utf-8 comments, gitweb highlight generate illegal chars. So I hacked gitweb.cgi, like this: --------------------------- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index dab89f2..48def38 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 --------------------------- And it works. But I wonder is this the rigtht solution. Anybody help me? -- Best Regards zzs