The encoding parameter is not the encoding of the buffer, it is the encoding of the string you are passing. Buffers have no encoding; they are just binary data. via @OrangeDog…