File handlewidechar.patch of Package perl-Net-HTTPServer
diff -Naur perl-Net-Http-Server-1.1.1.orig//lib/Net/HTTPServer/Response.pm perl-Net-Http-Server-1.1.1/lib/Net/HTTPServer/Response.pm
--- perl-Net-Http-Server-1.1.1.orig//lib/Net/HTTPServer/Response.pm 2005-01-06 04:58:16.000000000 +0100
+++ perl-Net-Http-Server-1.1.1/lib/Net/HTTPServer/Response.pm 2008-09-15 13:39:05.000000000 +0200
@@ -73,6 +73,10 @@
Returns the current value of the response body. Sets the content of
the response if a value is specified.
+Body() always returns the value as a utf8::encode()ed string.
+As a parameter it accepts both, perl unicode wide character strings
+or utf8 encoded byte strings.
+
=head2 Clear()
Reset the body to "".
@@ -194,7 +198,12 @@
my $self = shift;
my $body = shift;
- return $self->{BODY} unless defined($body);
+ unless (defined $body)
+ {
+ utf8::encode $self->{BODY} if utf8::is_utf8 $self->{BODY};
+ return $self->{BODY};
+ }
+
$self->{BODY} = $body;
}
@@ -401,7 +410,7 @@
chomp($header);
$header .= "\r\n\r\n";
- return ($header,$self->{BODY});
+ return ($header,$self->Body());
}