Unicode and bytes

Download python eBook

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...

Related Examples

Stats

57 Contributors: 2
Friday, July 22, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook