X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/1b2c33db144b6b7efb1b35e2b36cddffc660f493537889bf6be9accd5f2f4ea3..95e6f705b0d564e9a30ccb71cf131c92ad8cb7af373444ec23892ad17c1b2071:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 33a89d5..fb4cf84 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -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); @@ -6245,7 +6245,9 @@ sub git_blame_common { -type=>"text/plain", -charset => "utf-8", -status=> "200 OK"); local $| = 1; # output autoflush - print while <$fd>; + while (my $line = <$fd>) { + print to_utf8($line); + } close $fd or print "ERROR $!\n"; @@ -7864,11 +7866,12 @@ sub git_opml { -charset => 'utf-8', -content_disposition => 'inline; filename="opml.xml"'); + my $title = esc_html($site_name); print < - $site_name OPML Export + $title OPML Export