Subject: Re: [PATCH/RFC] Gitweb: Convert UTF-8 encoded file names

From: Junio C Hamano <[email-masked]>
Date: Thu, 15 May 2014 12:38:34 -0700

Jakub Narębski <[email-masked]> writes:

> Writing test for this would not be easy, and require some HTML
> parser (WWW::Mechanize, Web::Scraper, HTML::Query, pQuery,
> ... or low level HTML::TreeBuilder, or other low level parser).

Hmph.  Is it more than just looking for a specific run of %xx we
would expect to see in the output of the tree view for a repository
in which there is one tree with non-ASCII name?

>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index a9f57d6..f1414e1 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -7138,7 +7138,7 @@ sub git_tree {
>>         my @entries = ();
>>         {
>>                 local $/ = "\0";
>> -               open my $fd, "-|", git_cmd(), "ls-tree", '-z',
>> +               open my $fd, "-|encoding(UTF-8)", git_cmd(), "ls-tree", '-z',
>>                         ($show_sizes ? '-l' : ()), @extra_options, $hash
>>                         or die_error(500, "Open git-ls-tree failed");
>
> Or put
>
>                    binmode $fd, ':utf8';
>
> like in the rest of the code.

I expect a patch to do so and can forget about this thread myself,
then, OK?

Thanks all for digging this to the root.