X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/cbce69e6debd656e01f53fc8cb24f08fcde0b936330be3dccc59d15e667397c1..d54561ef6bee91436ad4d8fd465c1931f04d9bfac80f671c558b21acefab459b:/gitweb.cgi diff --git a/gitweb.cgi b/gitweb.cgi index 77b4c23..3cad1f1 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -47,7 +47,7 @@ my $projects_list = "index/index.aux"; # default blob_plain mimetype and default charset for text/plain blob my $default_blob_plain_mimetype = 'text/plain'; -my $default_text_plain_charset = 'utf-8'; # can be undefined +my $default_text_plain_charset = undef; # input validation and dispatch my $action = $cgi->param('a'); @@ -1523,9 +1523,9 @@ sub git_blob_plain { print $cgi->header(-type => "$type", '-content-disposition' => "inline; filename=\"$save_as\""); undef $/; - binmode STDOUT, ':raw' unless $type =~ m/^text\//; + binmode STDOUT, ':raw'; print <$fd>; - binmode STDOUT, ':utf8' unless $type =~ m/^text\//; + binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi $/ = "\n"; close $fd; }