Python codecs Library
The purpose of this module is Encoding and decoding i.e. conversion of the texts between different representations.
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.
The next two functions defined here are
1. codecs.register(encoding)
2. codecs.unregister(encoding)
codecs.register(search_function):
This function registers a new codec search function.
What do you mean by a search function?
Search Functions take one argument, that is the encoding name in lower letters with hyphens and spaces converted to underscores, and return a CodecInfo object. In case a search function cannot find a given encoding, it should return None
codecs.unregister(search_function):
This function unregisters a codec search function and clear the registry's cache. If the search function is already unregistered, it does nothing.
Comments