summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-05-04 06:26:54 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-05-04 06:26:54 (GMT)
commit9aae177a4adff326421e55c7c0f3138de15ce2c1 (patch)
treeca19b08ff373ea122f87c90d03d111b03a89921e /gitweb
parent50acc58914bf02217e55fdd739a844f2bfc45410 (diff)
parente3ad95a8be82663d27cb501eaf9bad86a30f9cda (diff)
downloadgit-9aae177a4adff326421e55c7c0f3138de15ce2c1.zip
git-9aae177a4adff326421e55c7c0f3138de15ce2c1.tar.gz
git-9aae177a4adff326421e55c7c0f3138de15ce2c1.tar.bz2
Merge branch 'maint'
* maint: gitweb: use decode_utf8 directly posix compatibility for t4200 Document 'opendiff' value in config.txt and git-mergetool.txt Allow PERL_PATH="/usr/bin/env perl" Make xstrndup common diff.c: fix "size cache" handling. http-fetch: Disable use of curl multi support for libcurl < 7.16.
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl26
1 files changed, 10 insertions, 16 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index cbd8d03..ba5cc43 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -564,12 +564,6 @@ sub validate_refname {
return $input;
}
-# very thin wrapper for decode("utf8", $str, Encode::FB_DEFAULT);
-sub to_utf8 {
- my $str = shift;
- return decode("utf8", $str, Encode::FB_DEFAULT);
-}
-
# quote unsafe chars, but keep the slash, even when it's not
# correct, but quoted slashes look too horrible in bookmarks
sub esc_param {
@@ -594,7 +588,7 @@ sub esc_html ($;%) {
my $str = shift;
my %opts = @_;
- $str = to_utf8($str);
+ $str = decode_utf8($str);
$str = $cgi->escapeHTML($str);
if ($opts{'-nbsp'}) {
$str =~ s/ /&nbsp;/g;
@@ -608,7 +602,7 @@ sub esc_path {
my $str = shift;
my %opts = @_;
- $str = to_utf8($str);
+ $str = decode_utf8($str);
$str = $cgi->escapeHTML($str);
if ($opts{'-nbsp'}) {
$str =~ s/ /&nbsp;/g;
@@ -891,7 +885,7 @@ sub format_subject_html {
if (length($short) < length($long)) {
return $cgi->a({-href => $href, -class => "list subject",
- -title => to_utf8($long)},
+ -title => decode_utf8($long)},
esc_html($short) . $extra);
} else {
return $cgi->a({-href => $href, -class => "list subject"},
@@ -1126,7 +1120,7 @@ sub git_get_projects_list {
if (check_export_ok("$projectroot/$path")) {
my $pr = {
path => $path,
- owner => to_utf8($owner),
+ owner => decode_utf8($owner),
};
push @list, $pr;
(my $forks_path = $path) =~ s/\.git$//;
@@ -1156,7 +1150,7 @@ sub git_get_project_owner {
$pr = unescape($pr);
$ow = unescape($ow);
if ($pr eq $project) {
- $owner = to_utf8($ow);
+ $owner = decode_utf8($ow);
last;
}
}
@@ -1630,7 +1624,7 @@ sub get_file_owner {
}
my $owner = $gcos;
$owner =~ s/[,;].*$//;
- return to_utf8($owner);
+ return decode_utf8($owner);
}
## ......................................................................
@@ -1713,7 +1707,7 @@ sub git_header_html {
my $title = "$site_name";
if (defined $project) {
- $title .= " - " . to_utf8($project);
+ $title .= " - " . decode_utf8($project);
if (defined $action) {
$title .= "/$action";
if (defined $file_name) {
@@ -1986,7 +1980,7 @@ sub git_print_page_path {
print "<div class=\"page_path\">";
print $cgi->a({-href => href(action=>"tree", hash_base=>$hb),
- -title => 'tree root'}, to_utf8("[$project]"));
+ -title => 'tree root'}, decode_utf8("[$project]"));
print " / ";
if (defined $name) {
my @dirname = split '/', $name;
@@ -2604,7 +2598,7 @@ sub git_project_list_body {
($pr->{'age'}, $pr->{'age_string'}) = @aa;
if (!defined $pr->{'descr'}) {
my $descr = git_get_project_description($pr->{'path'}) || "";
- $pr->{'descr_long'} = to_utf8($descr);
+ $pr->{'descr_long'} = decode_utf8($descr);
$pr->{'descr'} = chop_str($descr, 25, 5);
}
if (!defined $pr->{'owner'}) {
@@ -3636,7 +3630,7 @@ sub git_snapshot {
$hash = git_get_head_hash($project);
}
- my $filename = to_utf8(basename($project)) . "-$hash.tar.$suffix";
+ my $filename = decode_utf8(basename($project)) . "-$hash.tar.$suffix";
print $cgi->header(
-type => "application/$ctype",