Characters in Python

Jp Calderone exarkun at intarweb.us
Sun Jun 8 14:34:39 EDT 2003


On Sun, Jun 08, 2003 at 12:00:13PM +0200, Just wrote:
> In article <m33cilxebk.fsf at mira.informatik.hu-berlin.de>,
>  martin at v.loewis.de (Martin v. Löwis) wrote:
> 
> > jansun at home.se (Jan Sundström) writes:
> > 
> > > By the way, where do I find what strings are acceptable names for
> > > encodings?
> > 
> > http://www.python.org/dev/doc/devel/lib/node126.html
> 
> Is it possible to get at a list of the available encoding names at 
> runtime?
> 
> Just

  No.  Rather than registering encodings, in the Python system, you register
predicate functions.  When an encoding is requested, Python calls all the
registered predicates in turn with the encoding name.  When one returns the
appropriate values (encoder and decoder objects) rather than None, it uses
those objects to handle the encoding.

  Jp

-- 
Seduced, shaggy Samson snored.
She scissored short.  Sorely shorn,
Soon shackled slave, Samson sighed,
Silently scheming,
Sightlessly seeking
Some savage, spectacular suicide.
                -- Stanislaw Lem, "Cyberiad"





More information about the Python-list mailing list