git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Add charset info to "raw" blob output

From
JEJan Engelhardt <jengelh@medozas.de>
Date
Jun 1, 2008, 12:16 UTC
Message-ID
<alpine.LNX.1.10.0806011415270.4055@fbirervta.pbzchgretzou.qr>
In-Reply-To
<alpine.LNX.1.10.0806011413110.4055@fbirervta.pbzchgretzou.qr>
On Sunday 2008-06-01 14:15, Jan Engelhardt wrote:
Show 17 quoted lines
>On Sunday 2008-06-01 13:06, Jakub Narebski wrote:
>>> +	# 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.

Minor correction; s/file/output/. gitweb normaly produces HTML for all its normal views, so no Charset header here; but when it outputs "raw", it should provide one.

Previous: Jan EngelhardtNext: Jakub Narebski
Message 8 of 12 in “gitweb forgets to send utf8 header for raw blob views”
  1. Jan EngelhardtMay 28, 2008
  2. Lea WiemannMay 29, 2008
  3. Jakub NarebskiMay 30, 2008
  4. gitweb: Add charset info to "raw" blob outputJakub Narebski, May 31, 2008
  5. Junio C HamanoMay 31, 2008
  6. Jakub NarebskiJun 1, 2008
  7. Jan EngelhardtJun 1, 2008
  8. Jan EngelhardtJun 1, 2008
  9. gitweb: Add charset info to "raw" output of 'text/plain' blobsJakub Narebski, Jun 3, 2008
  10. Jan EngelhardtMay 31, 2008
  11. Jakub NarebskiMay 31, 2008
  12. Jan EngelhardtJun 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.