Re: [PATCH] gitweb: Add charset info to "raw" blob output
- From
- Jan Engelhardt <jengelh@medozas.de>
- Date
- Jun 1, 2008, 12:15 UTC
- Message-ID
- <alpine.LNX.1.10.0806011413110.4055@fbirervta.pbzchgretzou.qr>
- In-Reply-To
- <200806011306.45945.jnareb@gmail.com>
On Sunday 2008-06-01 13:06, Jakub Narebski wrote:
Show 12 quoted lines
>> + # Type specific postprocessing can be added as needed...
>> + if ($mime =~ /^text\//i &&
>> + $mime !~ /charset=/i && $default_text_plain_charset) {
>> + $mime .= '; charset='.$default_text_plain_charset;
>> + }
>> +
>> + return $mime;
>
>I'm not sure about it. I worry a bit about text/html, which can, and
>usually do, contain charset info inside the document. I'm not sure
>what happens when charset information from HTTP headers contradict
>charset information from presented file.The HTTP header takes -- as stupid as it looks -- precedence over the HTML header. As such, a charset in the HTTP Response Header should ONLY be sent if the file is guaranteed to be text/plain only.
>That's why I have limited >adding charset info purely to 'text/plain', not 'text/*' without >charset info already present.