got a new error "HTTP::Message content must be bytes"
Indeed it does. Sockets can only transmit bytes. As such, the payload of an HTTP message (request or response) can only contain bytes. It is your responsibility to serialize anything that isn't bytes, including text characters. You can use Encode for that.
if (utf8::is_utf8($v)){ utf8::encode($v); }
That makes no sense. You can't reliably determine whether the content of a string is encoded or decoded based on the internal encoding. See Re: Decoding, Encoding string, how to? (internal encoding). That line should simply be
utf8::encode($v);
If there's a problem with that, there's a problem elsewhere.
binmode STDOUT, ':utf8'; # Removes 'wide character' warnings
The following would be better
use open ':std', ':locale';
In reply to Re: Mechanize/LWP Error "Wide Character in syswrite"
by ikegami
in thread Mechanize/LWP Error "Wide Character in syswrite"
by hotsolutions
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |