[Python-Dev] "data".decode(encoding) ?!

M.-A. Lemburg mal@lemburg.com
Thu, 03 May 2001 11:05:41 +0200


Fredrik Lundh wrote:
> 
> mal wrote:
> 
> > Here's some sample output (Netscape can unscramble this BTW):
> 
> heh.  just discovered that outlook express can deal with this
> too -- but only if the message comes from the usenet.
> 
> on ordinary mail, the "unscramble rot13" menu entry is disabled
> (too much usability testing?)
> 
> maybe you could repost your secret message to comp.lang.python ;-)

It wasn't all that secret: I simply cut&pasted the first
two paragraphs of the message through the codec.

There was also an inaccuracy in the posting: the codec still
produces Unicode (by virtue of using the charmap codec as
basis). 

Still, it serves as nice example of what str.decode()
and str.encode() can be used for and also demonstrates how
easy it is to install new codecs.

I think I'll repost it to c.l.p though -- with a new secret 
attached to it ;-)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/