codecs.replace_errors(exception) Implements the 'replace' error handling (for text
codecs.backslashreplace_errors(exception) Implements the 'backslashreplace' error handling (for
IncrementalEncoder.setstate(state) Set the state of the encoder to state. state must be an encoder state returned
write(object) Writes the object’s contents encoded to the stream.
codecs.decode(obj, encoding='utf-8', errors='strict') Decodes obj using the codec registered for encoding
reset() Reset the encoder to the initial state. The output is discarded: call .encode(object, final=True), passing
codecs.register(search_function) Register a codec search function. Search functions are expected to take one argument, being
struct.pack(fmt, v1, v2, ...) Return a bytes object containing the values v1, v2, ... packed according to
codecs.getencoder(encoding) Look up the codec for the given encoding and return its encoder function. Raises
decode The stateless encoding and decoding functions. These must be functions or methods which have the same interface as the
Page 3 of 8