Diff of /branches/0.71/lib/SOAP/Transport/HTTP.pm [r364] .. [r365]  Maximize  Restore

  Switch to side-by-side view

--- a/branches/0.71/lib/SOAP/Transport/HTTP.pm
+++ b/branches/0.71/lib/SOAP/Transport/HTTP.pm
@@ -4,7 +4,7 @@
 # SOAP::Lite is free software; you can redistribute it
 # and/or modify it under the same terms as Perl itself.
 #
-# $Id: HTTP.pm 354 2010-03-18 18:29:09Z kutterma $
+# $Id: HTTP.pm 365 2010-04-27 18:58:52Z kutterma $
 #
 # ======================================================================
 
@@ -197,10 +197,15 @@
           # from string (doing pack with 'C0A*' modifier) if length and
           # bytelength are not the same
             my $bytelength = SOAP::Utils::bytelength($envelope);
-            $envelope = pack( 'C0A*', $envelope )
-              if !$SOAP::Constants::DO_NOT_USE_LWP_LENGTH_HACK
-                  && length($envelope) != $bytelength;
-
+			if ($] < 5.008) {
+				$envelope = pack( 'C0A*', $envelope );
+			}
+			else {
+				require Encode;
+				$envelope = Encode::encode('UTF-8', $envelope); 
+			}
+            #  if !$SOAP::Constants::DO_NOT_USE_LWP_LENGTH_HACK
+            #      && length($envelope) != $bytelength;
             $http_request->content($envelope);
             $http_request->protocol('HTTP/1.1');