]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: text files for 'blob_plain' action without charset by default
authorJakub Narebski <redacted>
Sat, 17 Jun 2006 16:07:24 +0000 (18:07 +0200)
committerLady <redacted>
Fri, 3 Apr 2026 05:12:42 +0000 (01:12 -0400)
$default_text_plain_charset is undefined (no specified charset) by
default. Additionally ':raw' layer for binmode is used for outputting file
content.

Signed-off-by: Junio C Hamano <redacted>
gitweb.cgi

index 77b4c23e5cdb0c9d1694ada023060d2cec3421f9f40ecd8457877b5ec636cb51..3cad1f1246441829317ef9dcb26752229747e38043c6fb6c9758790a99be2c4c 100755 (executable)
@@ -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;
 }
This page took 0.20508 seconds and 4 git commands to generate.