T
T Conti
Hello:
I am using LWP::UserAgent to make a vanilla request to a web service.
The return value is an XML file that may contain utf-8 characters.
However when I debug my module I see that the return test is getting
mangled. I can call the web service from IE and everything works
fine. Here is the code I am using to make the HTTP call:
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', $queryURL);
my $response = $ua->request($request);
my $string = $response->content;
The resulting string slams umlates among other things. Here is a
sample of the garbled return data:
<Location>DE-Baden W├╝rttemberg-76137 Karlsruhe</Location>
The proper return data should be:
<Location>DE-Baden Württemberg-Obersontheim</Location>
The return XML is utf-8 encoded. The headers of the response object
seem to reflect this:
$VAR1 = bless( {
'client-response-num' => '1',
'x-aspnet-version' => '1.1.4322',
'content-type' => 'text/xml; charset=utf-8',
'connection' => 'close',
'date' => 'Tue, 07 Sep 2004 20:54:00 GMT',
'server' => 'Microsoft-IIS/5.0',
'client-date' => 'Tue, 07 Sep 2004 20:54:00 GMT',
'content-length' => '18835',
'cache-control' => 'private',
'x-powered-by' => 'ASP.NET'
}, 'HTTP::Headers' );
Any thoughts on how to handle this?
Thanks,
T
I am using LWP::UserAgent to make a vanilla request to a web service.
The return value is an XML file that may contain utf-8 characters.
However when I debug my module I see that the return test is getting
mangled. I can call the web service from IE and everything works
fine. Here is the code I am using to make the HTTP call:
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', $queryURL);
my $response = $ua->request($request);
my $string = $response->content;
The resulting string slams umlates among other things. Here is a
sample of the garbled return data:
<Location>DE-Baden W├╝rttemberg-76137 Karlsruhe</Location>
The proper return data should be:
<Location>DE-Baden Württemberg-Obersontheim</Location>
The return XML is utf-8 encoded. The headers of the response object
seem to reflect this:
$VAR1 = bless( {
'client-response-num' => '1',
'x-aspnet-version' => '1.1.4322',
'content-type' => 'text/xml; charset=utf-8',
'connection' => 'close',
'date' => 'Tue, 07 Sep 2004 20:54:00 GMT',
'server' => 'Microsoft-IIS/5.0',
'client-date' => 'Tue, 07 Sep 2004 20:54:00 GMT',
'content-length' => '18835',
'cache-control' => 'private',
'x-powered-by' => 'ASP.NET'
}, 'HTTP::Headers' );
Any thoughts on how to handle this?
Thanks,
T