PyMOTW: codecs – String encoding and decoding

The codecs module provides stream and file interfaces for transcoding data in your program. It is most commonly used to work with Unicode text, but other encodings are also available for other purposes.

Read more at pymotw.com: codecs