PyDocs

Nav

Binary Data Services

Codec

codecs

class (source)
Defines the interface for stateless encoders/decoders.

The .encode()/.decode() methods may use different error
handling schemes by providing the errors argument. These
string values are predefined:

 'strict' - raise a ValueError error (or a subclass)
 'ignore' - ignore the character and continue with the next
 'replace' - replace with a suitable replacement character;
            Python will use the official U+FFFD REPLACEMENT
            CHARACTER for the builtin Unicode codecs on
            decoding and '?' on encoding.
 'surrogateescape' - replace with private code points U+DCnn.
 'xmlcharrefreplace' - Replace with the appropriate XML
                       character reference (only for encoding).
 'backslashreplace'  - Replace with backslashed escape sequences.
 'namereplace'       - Replace with \N{...} escape sequences
                       (only for encoding).

The set of allowed values can be extended via register_error.
Members of Codec

d

decode
Decodes the object input and returns a tuple (output object, length consumed).

e

encode
Encodes the object input and returns a tuple (output object, length consumed).
0 Examples
No examples for codecs/Codec.
See Also
No see-alsos for codecs/Codec
0 Notes
No notes for Codec