develooper Front page | perl.libwww | Postings from March 2003

Unicode POST problem

Thread Next
Dominic Mitchell
March 12, 2003 04:05
Unicode POST problem
Message ID:
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,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About