Allow specifying optional encoding for various methods
Added constants to deal with encodings