Fix content length with multi-byte characters

Currently the content length of response becomes the length of characters.
However, this must be the byte-length of characters.
With my Japanese shell environment, the error response can include multi-byte characters.