OverlordQ has asked for the wisdom of the Perl Monks concerning the following question:
eval { $content = $response->decoded_content }; if ($content) { $response->content($content); }
Looking through the libwww changelog I noticed: "Don't allow HTTP::Message content to be set to Unicode strings."*_utf8_downgrade = defined(&utf8::downgrade) ? sub { utf8::downgrade($_[0], 1) or Carp::croak("HTTP::Message content must be bytes") } : sub { };
HTTP/1.x 200 OK Date: Thu, 01 May 2008 02:30:39 GMT Server: Apache X-Powered-By: PHP/5.2.5 Cache-Control: private, s-maxage=0, max-age=0, must-revalidate Content-Language: en Vary: Accept-Encoding,Cookie Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Encoding: gzip Content-Length: 12241 Content-Type: text/html; charset=utf-8 Connection: keep-alive
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: libwww-perl, POE and Unicode
by Juerd (Abbot) on May 01, 2008 at 03:24 UTC | |
by danmcb (Monk) on May 05, 2008 at 09:28 UTC | |
by Juerd (Abbot) on May 05, 2008 at 10:36 UTC | |
by polettix (Vicar) on Jun 01, 2009 at 15:31 UTC | |
Re: libwww-perl, POE and Unicode
by rcaputo (Chaplain) on May 28, 2008 at 17:47 UTC |