]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Fix fallback mode of to_utf8 subroutine
[Gitweb] / gitweb.perl
index 0dbca9d055cf5f67cba476952780d4cd05f0e1d0b96efd080751cd1f1462f179..fb4cf84d591c40e9071c26ca7d1b0262bec5802088a2bedbf97eaff60701952a 100755 (executable)
@@ -1444,8 +1444,8 @@ sub validate_refname {
 sub to_utf8 {
        my $str = shift;
        return undef unless defined $str;
-       if (utf8::valid($str)) {
-               utf8::decode($str);
+
+       if (utf8::is_utf8($str) || utf8::decode($str)) {
                return $str;
        } else {
                return decode($fallback_encoding, $str, Encode::FB_DEFAULT);
This page took 0.168578 seconds and 4 git commands to generate.