Content-Length header for unicode strings

`Content-Length` header set incorrectly when `tags` or `message` contain non-ascii characters.