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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:01:11

Jakub Narębski [off-list ref] 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?
quoted
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.

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

From: Jakub Narębski <hidden>
Date: 2016-06-15 23:01:11

On Thu, May 15, 2014 at 9:38 PM, Junio C Hamano [off-list ref] wrote:
Jakub Narębski [off-list ref] writes:
quoted
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?
There is if we want to check (in non-fragile way) that said
specific run is in 'href' *attribute* of 'a' element (link target).

-- 
Jakub Narebski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help