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

Re: gitweb: charset problem

From
KSKay Sievers <kay.sievers@vrfy.org>
Date
Oct 24, 2005, 12:34 UTC
Message-ID
<20051024123457.GA30550@vrfy.org>
In-Reply-To
<20051024071839.GB4608@schottelius.org>
On Mon, Oct 24, 2005 at 09:18:39AM +0200, Nico -telmich- Schottelius wrote:
> gitweb (my $version =           "247";) seems to send utf-8 as meta tag encoding
> (<meta http-equiv="content-type" content="text/html; charset=utf-8"/>).

Yes, that's is intentional, also the http header is overwritten, if the webserver's default is not utf8.

> The problem is that the name of the user "HansjOErg" (OE is the german umlaut)
> is in iso8859-1 in /etc/passwd.

Huh, not sure if it's a good idea to put that into a username, never tried or ever seen that.

> This is guessed, but it does not look like utf-8, as it's a one byte encoding:
> 
> 00007b0: 3031 323a 3130 303a 4861 6e73 6af6 7267  012:100:Hansj.rg
Sure, 0xf6 is the single letter 'ö' (oe) in iso-8859.
> What would be the correct way to fix that? Change the username to utf-8?
> (Is this possible without causing problems in other programs?)
> Or tell gitweb that it should convert non-UTF-8 to UTF-8?

Don't know. At best get rid of the non-ascii chars in /etc/passwd if you don't want to get in trouble... :)

All other programs sure, should definitely use utf8.
> But we also have another problem: Sometimes we have umlauts in the commit messages.
> Those are also displayed incorrectly. When I switch to iso-8859-1 encoding in mozilla,
> the characters in the username and in the commit message are ok.

utf8 is the one and only sane encoding if you need more than ascii chars. Just convert everything to utf8 from your locale to your webserver and all that pain will go away immediately. :)

Best, Kay

Previous: Nico -telmich- Schottelius
Message 2 of 2 in “gitweb: charset problem”
  1. Nico -telmich- SchotteliusOct 24, 2005
  2. Kay SieversOct 24, 2005

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.