stop using encodeUtf8 on a byte sequence. form the write directly