[Python-Dev] Getting a list of registered codecs

Paul Moore p.f.moore at gmail.com
Tue Apr 30 11:52:49 CEST 2013


On 30 April 2013 10:42, M.-A. Lemburg <mal at egenix.com> wrote:

> It would be possible to get a list of registered codec search functions,
> but there's no API to ask the search functions for a list of supported
> codecs.
>

OK, so there's no way to determine in advance what values of enc will work
in bytestr.decode(enc) or str.encode(enc)?

Is there a reason why not? As I say, a tool that offers to re-encode a file
could reasonably be expected to list the encodings it supported (if only to
help the user work out which way to spell utf-16le or utf16le or utf16-le
or utf-16-le or... :-))

I've raised http://bugs.python.org/issue17878 for this. Further discussion
may be more appropriate there than on python-dev.

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130430/5b140ef6/attachment.html>


More information about the Python-Dev mailing list