libwww-perl, POE and Unicodeby OverlordQ (Hermit)
|on May 01, 2008 at 02:21 UTC||Need Help??|
OverlordQ has asked for the wisdom of the Perl Monks concerning the following question:
Seems the latest 'update' to libwww-perl broke things that used to work with POE::Component::Client::HTTP.
After the upgrade my script dies on certain requests but always in the same spot and giving the same error:
HTTP::Message content must be bytes at /home/overlordq/lib/POE/Component/Client/HTTP/Request.pm line 187
The relevant lines in PoCo::Client::HTTP are:
Digging through HTTP::Message, this has to do with utf8 stuff in the content, and the relevant lines in there are:
In the content subroutine is a call to _set_content, and in _set_content is a call to _utf8_downgrade:
Looking through the libwww changelog I noticed: "Don't allow HTTP::Message content to be set to Unicode strings."
Any suggestions on what's a man to do? And which module has the wrong behavior so I know where to report it? FWIW, here's the headers being sent back from the server that causes the error and possibly a related cpan bug: