18 Sep
2002
18 Sep
'02
6:08 a.m.
barry@python.org (Barry A. Warsaw) writes:
BG> Again, I assume you mean ISO-8859-1 instead of ascii here.
Same thing here. We do name.encode('us-ascii') and catch any UnicodeError that might occur.
That should be name.decode, or unicode(name, "us-ascii"). name.encode unfortunately works as well, but it first decodes using the system default encoding, then encodes using us-ascii - very close to what you want, but not the precise same thing. Regards, Martin