Content length should be based on the byte size of the content

Content length should be based on the byte size of the content rather than the string length. When working with UTF-8 data stored in hex notation in $content, length reads the hex values as a single character rather than the full length creating a malformed HTTP response.

For example:
$content = "\x{0100}"
length $content = 1
bytes $content = 8