Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorİsmail Dönmez <ismail@pardus.org.tr>2007-12-04 11:55:41 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-05 01:43:21 +0300
commite5d3de5c457d1a82c921b9bf2cd9a962970ce30e (patch)
treee2c0ff457e0c171396960b7931bbc76f234be8aa /gitweb
parentdcbcb707c366732c6b328ac6433d888f9915dcc5 (diff)
gitweb: use Perl built-in utf8 function for UTF-8 decoding.
Signed-off-by: İsmail Dönmez <ismail@pardus.org.tr> Tested-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl7
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);
}