codecs
codecs — Codec registry and base classes
This module defines base classes for standard Python codecs (encoders and decoders) and provides access to the internal Python codec registry which manages the codec and error handling lookup process.
It defines the following functions:
-
codecs.encode(obj[, encoding[, errors]])
-
Encodes obj using the codec registered for encoding. The default encoding is
'ascii'
.Errors may be given to set the desired error handling scheme. The default error handler is
'strict'
meaning that encoding errors raiseValueError
(or a more codec specific subclass, such as 登录查看完整内容