From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: [PATCH] gitweb: Convert project name to UTF-8 Date: Tue, 30 Jan 2007 19:23:38 +0900 Message-ID: <87hcu83hd7.wl@mail2.atmark-techno.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jan 30 12:08:11 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1HBqnK-0005Ey-7N for gcvg-git@gmane.org; Tue, 30 Jan 2007 12:04:58 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964845AbXA3LEz (ORCPT ); Tue, 30 Jan 2007 06:04:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933172AbXA3LEz (ORCPT ); Tue, 30 Jan 2007 06:04:55 -0500 Received: from mail2.atmark-techno.com ([210.191.215.173]:43527 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876AbXA3LEy (ORCPT ); Tue, 30 Jan 2007 06:04:54 -0500 Received: from wat.atmark-techno.com.atmark-techno.com (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id 53BBE3B8B8; Tue, 30 Jan 2007 20:04:52 +0900 (JST) User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: 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 "
"; 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