str.encode(encoding, errors='strict')
bytes.decode(encoding, errors='strict')
open(filename, mode, encoding=None)
ParameterDetailsencodingThe encoding to use, e.g. 'ascii', 'utf8', etc...errorsThe errors mode, e.g. 'replace' to replace bad characters with question marks, 'ignore' to ignore...