{"thread":{"id":"6582","subject":"[PATCH] gitweb: Convert project name to UTF-8","startedAt":"2007-01-30T10:23:38Z","lastAt":"2007-01-30T10:23:38Z","messageCount":1,"participants":["Yasushi SHOJI"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"33034","messageId":"87hcu83hd7.wl@mail2.atmark-techno.com","threadId":"6582","inReplyTo":null,"subject":"[PATCH] gitweb: Convert project name to UTF-8","fromName":"Yasushi SHOJI","fromEmail":"yashi@atmark-techno.com","sentAt":"2007-01-30T10:23:38Z","receivedAt":"2007-01-30T10:23:38Z","isPatch":true,"sender":{"key":"yashi@atmark-techno.com","avatar":"https://gravatar.com/avatar/4817e8703ac4379935834d87453faa9d0c94b9dc19d83fcc54c67875eb133e59?d=mp&s=160"},"body":"if repository directory name is non-ascii, $project need to be\nconverted from perl internal to utf-8 because it will be used as\ntitle, page path, and snapshot filename.\n\nuse to_utf8() to do the conversion.\n---\n gitweb/gitweb.perl |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex b606c1d..d7fe02c 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1690,7 +1690,7 @@ sub git_header_html {\n \n \tmy $title = \"$site_name\";\n \tif (defined $project) {\n-\t\t$title .= \" - $project\";\n+\t\t$title .= \" - \" . to_utf8($project);\n \t\tif (defined $action) {\n \t\t\t$title .= \"/$action\";\n \t\t\tif (defined $file_name) {\n@@ -1963,7 +1963,7 @@ sub git_print_page_path {\n \n \tprint \"<div class=\\\"page_path\\\">\";\n \tprint $cgi->a({-href => href(action=>\"tree\", hash_base=>$hb),\n-\t              -title => 'tree root'}, \"[$project]\");\n+\t              -title => 'tree root'}, to_utf8(\"[$project]\");\n \tprint \" / \";\n \tif (defined $name) {\n \t\tmy @dirname = split '/', $name;\n@@ -3610,7 +3610,7 @@ sub git_snapshot {\n \t\t$hash = git_get_head_hash($project);\n \t}\n \n-\tmy $filename = basename($project) . \"-$hash.tar.$suffix\";\n+\tmy $filename = to_utf8(basename($project)) . \"-$hash.tar.$suffix\";\n \n \tprint $cgi->header(\n \t\t-type => \"application/$ctype\",\n-- \n1.5.0.rc2.gdf391\n"}]}