fixed invalid content-length in request headers when using multibyte utf-8 characters

The http request header content-length should contain the byte and not the string length.