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

Re: [RFD] Handling of non-UTF8 data in gitweb

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2011, 00:37 UTC
Message-ID
<7vehwhcj3q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201112041709.32212.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 5 quoted lines
> But doing this would change gitweb behavior.  Currently when 
> encountering something (usually line of output) that is not valid 
> UTF-8, we decode it (to UTF-8) using $fallback_encoding, by default
> 'latin1'.  Note however that this value is per gitweb installation,
> not per repository.

I think we added and you acked 00f429a (gitweb: Handle non UTF-8 text better, 2007-06-03) for a good reason, and I think the above argues that whatever issue the commit tried to address is a non-issue. Is it really true?

> ... I guess
> it could be emulated by defining our own 'utf-8-with-fallback'
> encoding, or by defining our own PerlIO layer with PerlIO::via.
> But it no longer be simple solution (though still automatic).

Between the current "everybody who read from the input must remember to call to_utf8" and "everybody gets to read utf8 automatically for internal processing", even though the latter may involve one-time pain to set up the framework to do so, the pros-and-cons feels obvious to me.

Previous: Jeff KingNext: Jakub Narebski
Message 3 of 7 in “[RFD] Handling of non-UTF8 data in gitweb”
  1. Jakub NarebskiDec 4, 2011
  2. Jeff KingDec 6, 2011
  3. Junio C HamanoDec 7, 2011
  4. Jakub NarebskiDec 10, 2011
  5. Junio C HamanoDec 12, 2011
  6. Jakub NarebskiDec 18, 2011
  7. Jakub NarebskiJan 6, 2012

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.