Added setEncoding