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

Ulrich Eckhardt eckhardt at satorlaser.com
Tue Jan 12 07:04:23 EST 2010


Jens Müller wrote:
> I try to decode a string,e.g.
> u'M\xfcnchen, pronounced [\u02c8m\u028fn\xe7\u0259n]'.decode('cp1252',
> 'ignore')
> but even thoug I use errors='ignore'
> I get UnicodeEncodeError: 'charmap' codec can't encode character u'\u02c8'
> in position 21: character maps to <undefined>
> 
> How come?

Wrong way? Don't you want to encode the Unicode string using codepage 1252
instead?

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list