git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: Convert project name to UTF-8

From
Yasushi SHOJI <yashi@atmark-techno.com>
Date
Jan 30, 2007, 10:23 UTC
Message-ID
<87hcu83hd7.wl@mail2.atmark-techno.com>

if repository directory name is non-ascii, $project need 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.
---
 gitweb/gitweb.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b606c1d..d7fe02c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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) {
@@ -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;
@@ -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",
-- 
1.5.0.rc2.gdf391
Message 1 of 1 in “gitweb: Convert project name to UTF-8”
  1. gitweb: Convert project name to UTF-8Yasushi SHOJI, Jan 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.