Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 58994
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: mutant.nz [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.836
Fixed in: (no value)



Subject: HTTP::Request::Common url encoding strips out wide characters
When passing a wide character to HTTP::Request::Common POST (for instance), the character is stripped out when it's url-encoded. Minimal example: my $req = POST 'http://myurl.com', {r=>"test\x{101}"}; print $req->{_content} . "\n"; # prints "r=test" The simple workaround is to encode any strings as utf8 before passing them to HTTP::Request::Common, but this still seems like a bug to me. (Tested in perl 5.10.1).
What version of LWP and URI do you have installed? Here I see: $ perl -MHTTP::Request::Common -e 'POST("http://www.example.com", {r => "test\x{101}"})- Show quoted text
>dump'
POST http://www.example.com Content-Length: 12 Content-Type: application/x-www-form-urlencoded r=test%C4%81
From: mutant.nz [...] gmail.com
On Thu Jul 01 02:12:13 2010, GAAS wrote: Show quoted text
> What version of LWP and URI do you have installed?
Apologies for taking almost a year to get back to you... I have LWP 6, but I would guess the actual bug is in a dependency that has an older version. I get this problem on my Lenny(ish) system, but on a newer Ubuntu server it's fine. So I guess this has already been fixed. Thanks.
On Tue Jun 28 18:20:47 2011, Mutant wrote: Show quoted text
> I have LWP 6, but I would guess the actual bug is in a dependency that > has an older version. I get this problem on my Lenny(ish) system, but on > a newer Ubuntu server it's fine.
It is indeed an issue in a dependency. I've tracked it down to URI::Escape. Version 1.35 as in Debian Lenny is broken, but version 1.37 in Lenny backports is fine. Between those two versions escaping in query_from changed from a hash lookup to a function call to escape_char. The escape_char handles UTF8 correctly. Upshot, not an issue in HTTP::Request::Common, and an issue that was resolved a number of years ago. Cheers!