mysterious unicode

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Mar 20 19:58:01 EDT 2007


En Tue, 20 Mar 2007 20:47:22 -0300, Gerry <gerard.blais at gmail.com>  
escribió:

> Thanks! - that helps a lot.
>
> I'm still mystified why:
>    qno was ever unicode, and why

I can't tell...

>    qno.encode("ascii", "replace") is still unicode.

That *returns* a string, but you are discarding the return value. Should  
be qno = qno.encode(...)
It's similar to lower(), by example.

-- 
Gabriel Genellina




More information about the Python-list mailing list