Re: [PATCH/RFC] Gitweb: Convert UTF-8 encoded file names
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 15, 2014, 19:38 UTC
- Message-ID
- <xmqqmweiessl.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CANQwDwe+GJ+yAYWdVfMaHq97zGXBoepCfUdLiaQD9LFoz3SiOA@mail.gmail.com>
Jakub Narębski <jnareb@gmail.com> 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?
Show 18 quoted lines
>> 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.