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

Re: gitweb - encoding problems

From
Jakub Narebski <jnareb@gmail.com>
Date
May 22, 2007, 07:50 UTC
Message-ID
<200705220950.35493.jnareb@gmail.com>
In-Reply-To
<1179794012.2771.112.camel@shinybook.infradead.org>
On Thu, 22 May 2007, David Woodhouse wrote:
> On Mon, 2007-05-21 at 22:57 +0200, Martin Koegler wrote:
Show 9 quoted lines
>> I use ISO-8859-1 as my locale, so my blobs, commits and tags are in
>> this encoding. 
> 
> That's a very strange thing for anyone to do in the 21st century.
> Did you configure this archaic thing correctly in .git/config?
> 
> Otherwise, gitweb will assume that you're using utf-8 like any normal
> person would, and of course you'll have problems when it tries to deal
> with your legacy character set as if it were something sensible.

Actually gitweb does not respect i18n.* configuration variables and happily assumes that everything is in utf-8, with the exception of *_plain views, which are send :raw.

If you decide to implement supporting encodings other that utf-8 in gitweb, please remember that some (like git-show, git-log) but not all parts (like git-rev-list or --pretty=raw) do the decoding/encoding. And that git can be compiled without iconv support. And that comits might be in different encodings, which should be given by 'encoding' header, but there is no way to guess encoding for a blob, or for a file names.

git-commit(1):
 i18n.commitEncoding::
     Character encoding the commit messages are stored in; git itself
     does not care per se, but this information is necessary e.g. when
     importing commits from emails or in the gitk graphical history
     browser (and possibly at other places in the future or in other
     porcelains). See e.g. gitlink:git-mailinfo[1]. Defaults to 'utf-8'.
 i18n.logOutputEncoding::
     Character encoding the commit messages are converted to when
     running `git-log` and friends.
-- 
Jakub Narebski
Poland
Previous: David Woodhouse
Message 4 of 4 in “gitweb - encoding problems”
  1. Martin KoeglerMay 21, 2007
  2. Ismail DönmezMay 21, 2007
  3. David WoodhouseMay 22, 2007
  4. Jakub NarebskiMay 22, 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.