Configure encoding
PATCH 1/1 Configure encoding
The following patch makes it easy to change the encoding:
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +5 -4
@@ -20,6 +20,9 @@ my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; +my $encoding = "utf-8"; +$encoding = "iso-8859-1"; + # absolute fs-path which will be prepended to the project path my $projectroot = "/pub/scm"; $projectroot = "pub/scm";
@@ -183,9 +186,9 @@ $title .= "/$action"; } } - print $cgi->header(-type=>'text/html', -charset => 'utf-8', -status=> $status); + print $cgi->header(-type=>'text/html', -charset => $encoding, -status=> $status); print <<EOF; -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="$encoding"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <!-- git web interface v$version, (C) 2005, Kay Sievers
<kay.sievers\@vrfy.org>, Christian Gierke <ch\@gierke.de> --> @@ -1112,8 +1115,8 @@
my (@revlist) = map { chomp; $_ } <$fd>;
close $fd || die_error(undef, "Reading rev-list failed.");- print $cgi->header(-type => 'text/xml', -charset => 'utf-8');
- print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
+ print $cgi->header(-type => 'text/xml', -charset => $encoding);
+ print "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n".
"<rss version=\"0.91\">\n";
print "<channel>\n";
print "<title>$project</title>\n".Thomas
Signature · 2 lines
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie! Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 line 24
Quoted 11 lines · Thomas Kolejka
The following patch makes it easy to change the encoding:
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +2
-0@@ -20,6 +20,9 @@ my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; +my $encoding = "utf-8"; +$encoding = "iso-8859-1";
The upstream version will not support anything but the one and only sane encoding which is utf-8. It will not provide options to switch back to the 80's, sorry. :)
Thanks,
Kay
Dear diary, on Tue, May 31, 2005 at 11:19:55AM CEST, I got a letter where Kay Sievers <[email protected]> told me that...
Quoted 10 lines · Thomas Kolejka
Quoted 9 lines
The following patch makes it easy to change the encoding:
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +0
-0@@ -20,6 +20,9 @@ my $my_uri = $cgi->url(-absolute => 1); my $rss_link = "";
Quoted 6 lines
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 line 24
Quoted 2 lines
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +2
-0+my $encoding = "utf-8"; +$encoding = "iso-8859-1";The upstream version will not support anything but the one and only sane encoding which is utf-8. It will not provide options to switch back to the 80's, sorry. :)
This matters mainly for commits, right?
Perhaps I should recode from current locale to utf8 in cg-commit?
Signature · 3 lines
Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Quoted 12 lines · Petr Baudis
Dear diary, on Tue, May 31, 2005 at 11:19:55AM CEST, I got a letter where Kay Sievers <[email protected]> told me that...
Quoted 10 lines · Thomas Kolejka
Quoted 9 lines
The following patch makes it easy to change the encoding:
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +0
-0@@ -20,6 +20,9 @@ my $my_uri = $cgi->url(-absolute => 1); my $rss_link = "";
Quoted 8 lines
Quoted 6 lines
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 line 24
Quoted 2 lines
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +2
-0+my $encoding = "utf-8"; +$encoding = "iso-8859-1";The upstream version will not support anything but the one and only sane encoding which is utf-8. It will not provide options to switch back to the 80's, sorry. :)
This matters mainly for commits, right?
Yes. Also the content of the files, but fortunately they are just plain ascii most of the time. :)
Quoted 1 line
Perhaps I should recode from current locale to utf8 in cg-commit?
Everthing else than utf-8 is just a complete mess with data shared across multiple machines. All modern distributions defaulting to utf-8 anyway, so I think it is sane to recode that utf-8.
Kay
Quoted 28 lines
--- Ursprüngliche Nachricht ---
Von: Kay Sievers <[email protected]>
An: Petr Baudis <[email protected]>
Kopie: Thomas Kolejka <[email protected]>, Git Mailing List <[email protected]>
Betreff: Re: [gitweb PATCH] Configure encoding
Datum: Tue, 31 May 2005 12:44:25 +0200Quoted 19 lines · Petr Baudis
Dear diary, on Tue, May 31, 2005 at 11:19:55AM CEST, I got a letter where Kay Sievers <[email protected]> told me that...
Quoted 16 lines · Thomas Kolejka
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 line 24
Quoted 11 lines
The following patch makes it easy to change the encoding:
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +2
-0@@ -20,6 +20,9 @@ my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; +my $encoding = "utf-8"; +$encoding = "iso-8859-1";The upstream version will not support anything but the one and only sane encoding which is utf-8. It will not provide options to switch back to the 80's, sorry. :)
Quoted 4 lines
Quoted 1 line
This matters mainly for commits, right?
Yes. Also the content of the files, but fortunately they are just plain ascii most of the time. :)
I've made this changes becausae the german letters like ä, ö, ... are displayed ugly in the browser.
Quoted 8 lines
Quoted 1 line
Perhaps I should recode from current locale to utf8 in cg-commit?
Everthing else than utf-8 is just a complete mess with data shared across multiple machines. All modern distributions defaulting to utf-8 anyway, so I think it is sane to recode that utf-8.
Kay
-
The patch is to _change_ the encoding easy .. or to leave it unchanged.
Thomas
Signature · 2 lines
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis ++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++
Quoted 28 lines · Thomas Kolejka
Quoted 28 lines
--- Ursprüngliche Nachricht ---
Von: Kay Sievers <[email protected]>
An: Petr Baudis <[email protected]>
Kopie: Thomas Kolejka <[email protected]>, Git Mailing List <[email protected]>
Betreff: Re: [gitweb PATCH] Configure encoding
Datum: Tue, 31 May 2005 12:44:25 +0200Quoted 19 lines · Petr Baudis
Dear diary, on Tue, May 31, 2005 at 11:19:55AM CEST, I got a letter where Kay Sievers <[email protected]> told me that...
Quoted 16 lines · Thomas Kolejka
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 line 24
Quoted 11 lines
The following patch makes it easy to change the encoding:
gitweb.cgi.p 2005-05-31 09:48:46.000000000 +0200 renamed from gitweb.cgi.177 2005-05-31 09:43:17.000000000 +0200 +2
-0@@ -20,6 +20,9 @@ my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; +my $encoding = "utf-8"; +$encoding = "iso-8859-1";The upstream version will not support anything but the one and only sane encoding which is utf-8. It will not provide options to switch back to the 80's, sorry. :)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
This matters mainly for commits, right?
Yes. Also the content of the files, but fortunately they are just plain ascii most of the time. :)
I've made this changes becausae the german letters like ä, ö, ... are displayed ugly in the browser.
So use a sane encoding in your commit-text. We don't store the encoding with the commit, so you don't have any sane other option besides using utf-8 if you don't use plain ascii.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Perhaps I should recode from current locale to utf8 in cg-commit?
Everthing else than utf-8 is just a complete mess with data shared across multiple machines. All modern distributions defaulting to utf-8 anyway, so I think it is sane to recode that utf-8.
The patch is to _change_ the encoding easy .. or to leave it unchanged.
Exactly. Change to other encodings is not supported upstream and will not be a configuration value, sorry.
Kay