Subject: | SOAP::Lite Passes Decoded Strings to LWP |
Date: | Mon, 14 Apr 2008 18:35:26 -0700 |
To: | bug-SOAP-Lite [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
Since LWP 5.810, SOAP::Lite has been emitting this error:
HTTP::Message content not bytes at /usr/local/lib/perl5/site_perl/
5.10.0/SOAP/Transport/HTTP.pm line 426
This is because LWP 5.810 and later properly checks strings passed to
it to make sure that the utf8 flag is false. Only bytes should be
passed to LWP::Message, not unencoded Perl strings. This patch fixes
the issue for me, though I find the internals of SOAP::Lite to be
bewildering enough not to know if this is the best spot for it.
--- lib/SOAP/Lite.org 2008-04-14 18:30:15.000000000 -0700
+++ lib/SOAP/Lite.pm 2008-04-14 18:34:58.000000000 -0700
@@ -1613,7 +1613,13 @@
# return $self->context->packager->package($self-
Show quoted text
>xmlize($encoded));
}
- return $self->xmlize($encoded);
+ my $ret = $self->xmlize($encoded);
+ if ( $] > 5.007 ) {
+ require Encode;
+ return Encode::encode( $self->encoding, $ret )
+ if Encode::is_utf8($ret);
+ }
+ return $ret;
}
#
======================================================================
Best,
David