SVN::Web Charset Patch
Recently I discovered in my SVN::Web installation that they send out an Content-Type header with UTF-8 charset but i need ISO-8859-1 and there is no parameter in the config.
So i wrote a little patch for SVN::Web 0.53. If you use FreeBSD you can put this into /usr/ports/devel/p5-SVN-Web/files/patch-charset.diff and be happy with it.
--- lib/SVN/Web.pm.orig 2007-04-29 19:22:51.000000000 +0000
+++ lib/SVN/Web.pm 2008-01-16 12:39:34.000000000 +0000
@@ -345,7 +345,7 @@
if(ref($html)) {
print $cfg->{cgi}->header(
- -charset => $html->{charset} || 'UTF-8',
+ -charset => $html->{charset} || 'ISO-8859-1',
-type => $html->{mimetype} || 'text/html',
-cookie => @cookies,
);
@@ -361,7 +361,7 @@
}
} else {
print $cfg->{cgi}->header(
- -charset => 'UTF-8',
+ -charset => 'ISO-8859-1',
-type => 'text/html',
-cookie => @cookies,
);
@@ -391,7 +391,7 @@
if(ref($html)) {
my $content_type = $html->{mimetype} || 'text/html';
$content_type .= '; charset=';
- $content_type .= $html->{charset} || 'UTF-8';
+ $content_type .= $html->{charset} || 'ISO-8859-1';
$cfg->{request}->content_type($content_type);
if(mod_perl_2) {
@@ -411,7 +411,7 @@
$cfg->{request}->print($html->{body});
}
} else {
- $cfg->{request}->content_type('text/html; charset=UTF-8');
+ $cfg->{request}->content_type('text/html; charset=ISO-8859-1');
if(mod_perl_2) {
$cfg->{request}->headers_out();
Programming, FreeBSD : Read more : comments (0) : 16.01.2008 12:46
Comments
no comments