From: Romano Giannetti <romano@dea.icai.upcomillas.es>
To: git@vger.kernel.org
Subject: Best way to use gitweb with a non-utf8 git repository
Date: Mon, 19 Dec 2005 14:55:14 +0100 [thread overview]
Message-ID: <20051219135514.GA22388@pern.dea.icai.upcomillas.es> (raw)
Hi,
I am trying to start using git for a little project I have here. I
stumbled with a small difficulty with gitweb.
For historical reasons the 3 or 4 files in my project that are not ascii
or binary blobs are encoded in iso-8859-1. I know that utf8 is better,
but I cannot do anything to enforce it... Well, git obviously has no
problem, "all-is-a-byte-stream" is a great thing. The only problem is in
"tree" view of gitweb, were the files with iso-8859-1 are filled with
"invalid unicode sequence" symbols. I horribly hacked gitweb like this:
--- /home/romano/software/downloads/gitweb.cgi 2005-12-16 12:10:46.000000000 +0100
+++ /var/www/cgi-bin/gitweb.cgi 2005-12-19 12:20:25.000000000 +0100
@@ -221,6 +221,7 @@
# replace invalid utf8 character with SUBSTITUTION sequence
sub esc_html {
my $str = shift;
+ Encode::from_to($str, "iso-8859-1", "utf8");
$str = decode("utf8", $str, Encode::FB_DEFAULT);
$str = escapeHTML($str);
return $str;
but I wonder, is there a way to say gitweb "if invalid utf-8 is found,
assume whatever-encoding-is encoding"?
Thanks,
Romano
--
Romano Giannetti - Univ. Pontificia Comillas (Madrid, Spain)
Electronic Engineer - phone +34 915 422 800 ext 2416 fax +34 915 596 569
http://www.dea.icai.upcomillas.es/romano/
reply other threads:[~2005-12-19 13:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051219135514.GA22388@pern.dea.icai.upcomillas.es \
--to=romano@dea.icai.upcomillas.es \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox