Fix buffer encoded as utf8 string