diff options
| author | Junio C Hamano <gitster@pobox.com> | 2007-12-10 01:22:42 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2007-12-10 01:22:42 -0800 |
| commit | 7be2b6e02b4f2a1b4812764f65b12cafb11a934e (patch) | |
| tree | c94ad7eb3a4d478a1c71eb6ef0aaf1c0f7348660 /gitweb/gitweb.perl | |
| parent | c07a07c588fea82c2426d795a75324b3035c0a71 (diff) | |
| parent | 591aa2536fdbc4090ba8d4ca512d4ee7df4bf05d (diff) | |
| download | git-7be2b6e02b4f2a1b4812764f65b12cafb11a934e.tar.gz | |
Merge branch 'master' into cc/help
This is to primarily pull in MANPATH tweak and help.txt formatting fix
from the master branch.
Diffstat (limited to 'gitweb/gitweb.perl')
| -rwxr-xr-x | gitweb/gitweb.perl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ff5daa7901..24b31582af 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -695,10 +695,9 @@ sub validate_refname { # in utf-8 thanks to "binmode STDOUT, ':utf8'" at beginning sub to_utf8 { my $str = shift; - my $res; - eval { $res = decode_utf8($str, Encode::FB_CROAK); }; - if (defined $res) { - return $res; + if (utf8::valid($str)) { + utf8::decode($str); + return $str; } else { return decode($fallback_encoding, $str, Encode::FB_DEFAULT); } |
