Skip to content

Commit

Permalink
gitweb: Convert project name to UTF-8
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yasushi SHOJI authored and Junio C Hamano committed Feb 5, 2007
1 parent b2e69f6 commit 0417941
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ sub git_header_html {

my $title = "$site_name";
if (defined $project) {
$title .= " - $project";
$title .= " - " . to_utf8($project);
if (defined $action) {
$title .= "/$action";
if (defined $file_name) {
Expand Down Expand Up @@ -1963,7 +1963,7 @@ sub git_print_page_path {

print "<div class=\"page_path\">";
print $cgi->a({-href => href(action=>"tree", hash_base=>$hb),
-title => 'tree root'}, "[$project]");
-title => 'tree root'}, to_utf8("[$project]");
print " / ";
if (defined $name) {
my @dirname = split '/', $name;
Expand Down Expand Up @@ -3610,7 +3610,7 @@ sub git_snapshot {
$hash = git_get_head_hash($project);
}

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

print $cgi->header(
-type => "application/$ctype",
Expand Down

0 comments on commit 0417941

Please sign in to comment.