Handle UTF-8 multibyte sequences in node

Content-length header was set to the length of the string, which does not take into account multibyte sequences in UTF-8 strings. Now converts first to a buffer to get the proper length.