Skip to content

Commit 0417941

Browse files
yashiJunio C Hamano
authored andcommitted
gitweb: Convert project name to UTF-8
If the repository directory name is in non-ascii, $project needs to be converted from perl internal to utf-8 because it will be used as title, page path, and snapshot filename. use to_utf8() to do the conversion. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent b2e69f6 commit 0417941

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitweb/gitweb.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ sub git_header_html {
16901690

16911691
my $title = "$site_name";
16921692
if (defined $project) {
1693-
$title .= " - $project";
1693+
$title .= " - " . to_utf8($project);
16941694
if (defined $action) {
16951695
$title .= "/$action";
16961696
if (defined $file_name) {
@@ -1963,7 +1963,7 @@ sub git_print_page_path {
19631963

19641964
print "<div class=\"page_path\">";
19651965
print $cgi->a({-href => href(action=>"tree", hash_base=>$hb),
1966-
-title => 'tree root'}, "[$project]");
1966+
-title => 'tree root'}, to_utf8("[$project]");
19671967
print " / ";
19681968
if (defined $name) {
19691969
my @dirname = split '/', $name;
@@ -3610,7 +3610,7 @@ sub git_snapshot {
36103610
$hash = git_get_head_hash($project);
36113611
}
36123612

3613-
my $filename = basename($project) . "-$hash.tar.$suffix";
3613+
my $filename = to_utf8(basename($project)) . "-$hash.tar.$suffix";
36143614

36153615
print $cgi->header(
36163616
-type => "application/$ctype",

0 commit comments

Comments
 (0)