decode(..., errors='ignore') has no effect

Jens Müller me4 at privacy.net
Tue Jan 12 07:50:18 EST 2010


> To convert unicode into str you have to *encode()* it.
>
> u"...".decode(...) will implicitly convert to ASCII first, i. e. is
> equivalent to
>
> u"...".encode("ascii").decode(...)
>
> Hence the error message

Ah - yes of course.

And how can you use the system's default encoding with errors=ignore?
The default encoding is the one that is used if no parameters are given to 
"encode".

Thanks again!




More information about the Python-list mailing list