]> Lady’s Gitweb - Gitweb/commit
gitweb: Add charset info to "raw" output of 'text/plain' blobs
authorJakub Narebski <redacted>
Tue, 3 Jun 2008 14:47:10 +0000 (16:47 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:33 +0000 (00:07 -0400)
commit91c72e21017124d74263f1e83de35ded9209cbdec2d97fdbdfc0cf66c9211ca0
tree78974d1ab91103ae7610391dbc1eaa3d5f5eb8eca8e4f015982a9854ab60bd71
parentd802081da9fbd2c4a770512dd34d15294eccc5c56b61c76033acc6247802da97
gitweb: Add charset info to "raw" output of 'text/plain' blobs

Earlier "blob_plain" view sent "charset=utf-8" only when gitweb
guessed the content type to be text by reading from it, and not when
the MIME type was obtained from /etc/mime.types, or when gitweb
couldn't guess mimetype and used $default_blob_plain_mimetype.

This fixes the bug by always add charset info from
$default_text_plain_charset (if it is defined) to "raw" (a=blob_plain)
output for 'text/plain' blobs.

Generating information for Content-Type: header got separated into
blob_contenttype() subroutine; adding charset info in a special case
was removed from blob_mimetype(), which now should return mimetype
only.

While at it cleanup code a bit: put subroutine parameter
initialization first, make error message more robust (when $file_name
is not defined) if more cryptic, remove unnecessary '"' around
variable ("$var" -> $var).

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.221222 seconds and 4 git commands to generate.