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>
Yasushi SHOJI committed
Jan 30, 2007 at 19:23 UTC
041794188ff4f7a0b3ada8058d174a0c114da78b
1 file changed
+3
-3
gitweb/gitweb.perl
+3
-3
@@ -1690,7 +1690,7 @@ sub git_header_html {
1690
1691
my $title = "$site_name";
1692
if (defined $project) {
1693
- $title .= " - $project";
1693
+ $title .= " - " . to_utf8($project);
1694
if (defined $action) {
1695
$title .= "/$action";
1696
if (defined $file_name) {
@@ -1963,7 +1963,7 @@ sub git_print_page_path {
1963
1964
print "<div class=\"page_path\">";
1965
print $cgi->a({-href => href(action=>"tree", hash_base=>$hb),
1966
- -title => 'tree root'}, "[$project]");
1966
+ -title => 'tree root'}, to_utf8("[$project]");
1967
print " / ";
1968
if (defined $name) {
1969
my @dirname = split '/', $name;
@@ -3610,7 +3610,7 @@ sub git_snapshot {
3610
$hash = git_get_head_hash($project);
3611
}
3612
3613
- my $filename = basename($project) . "-$hash.tar.$suffix";
3613
+ my $filename = to_utf8(basename($project)) . "-$hash.tar.$suffix";
3614
3615
print $cgi->header(
3616
-type => "application/$ctype",