I'm trying to upload a file to a server, but it's failing because the content-length is incorrect. This is because the content is UTF-8 and length() is reporting characters, not bytes.

Attached is a small test to demonstrate this.

I would imagine that somewhere in the bowels of HTTP::Request, bytes::length() needs to be used instead of the default CORE::length(), which reports characters. Or maybe call decode('utf8', $content). But that would involve knowing more about the character sets in use...

Many thanks,
-Dom

Reply via email to