Re: gitweb highligh generate illegal char when the content had utf-8 chars
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Aug 4, 2011, 09:39 UTC
- Message-ID
- <CANQwDwcR5sS3-m6SifQbjU1VoS5bxRRGJNZZj0U+zp=zsoGbLA@mail.gmail.com>
- In-Reply-To
- <CALkWK0kURz_Rax-JOPT2sW1x4VrqWk=KDjUzzw4apacDo1UTyg@mail.gmail.com>
On Thu, Aug 4, 2011 at 11:11 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
> zzs writes:
Show 16 quoted lines
>> 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!<div class="pre"><a id="l%i" href="%s#l%i" class="linenr">%4i</a> %s</div>\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
>
> Looks sane, but I don't know enough about Gitweb to comment.
> +CC: Jakub, who can probably say more.This looks correct.
-- Jakub Narebski