Use Buffer.byteLength instead of String.prototype.length to set

data length because the latter does not measure correctly for
multi byte characters.