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

Re: [PATCH] gitweb: handle non UTF-8 text

From
Petr Baudis <pasky@suse.cz>
Date
May 28, 2007, 23:21 UTC
Message-ID
<20070528232139.GU4489@pasky.or.cz>
In-Reply-To
<1180385254576-git-send-email-mkoegler@auto.tuwien.ac.at>
On Mon, May 28, 2007 at 10:47:34PM CEST, Martin Koegler wrote:
Show 14 quoted lines
> gitweb assumes, that everything is in UTF-8. If a text contains invalid
> UTF-8 character sequences, the text must be in a different encoding.
> 
> This patch interprets such a text as latin1.
> 
> Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
> ---
> For correct UTF-8, the patch does not change anything.
> 
> If commit/blob/... is not in UTF-8, it displays the text
> with a very high probability correct. 
> 
> As git itself is not aware of any encoding, I know no better
> possibility to handle non UTF-8 text in gitweb.

I don't think this is a reasonable approach; I actually dispute the high probability - in western Europe it's obvious to assume latin1, but does majority of users using non-ascii characters come from there? Or rather from central Europe (like me, Petr Baudiš? ;-))? Somewhere else?

If we do something like this, we should do it properly and look at configured i18n.commitEncoding for the project. (But as config lookup may be expensive, probably do it only when we need it.)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
		-- Samuel Beckett
Previous: Martin KoeglerNext: Jakub Narebski
Message 2 of 9 in “gitweb: handle non UTF-8 text”
  1. gitweb: handle non UTF-8 textMartin Koegler, May 28, 2007
  2. Petr BaudisMay 28, 2007
  3. Jakub NarebskiMay 29, 2007
  4. Martin KoeglerMay 29, 2007
  5. Robin RosenbergMay 30, 2007
  6. Jakub NarebskiJun 1, 2007
  7. Junio C HamanoJun 2, 2007
  8. Jakub NarebskiJun 3, 2007
  9. Alexandre JulliardJun 3, 2007

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.