Python LanguageUnicode and bytes


Syntax

  • str.encode(encoding, errors='strict')
  • bytes.decode(encoding, errors='strict')
  • open(filename, mode, encoding=None)

Parameters

ParameterDetails
encodingThe encoding to use, e.g. 'ascii', 'utf8', etc...
errorsThe errors mode, e.g. 'replace' to replace bad characters with question marks, 'ignore' to ignore bad characters, etc...