[mailinglist] Re: [Python-de] htmllib und Umlaute
Klaus Meyer
km-news1 at onlinehome.de
Sun Apr 27 18:46:55 EDT 2003
Hallo,
Danke für alle Antworten und Links!
Hier noch zum Abschluss ein kleiner Effekt:
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
>>> u"abc\xe4".encode("latin-1")
'abc\xe4'
>>> "abc\xe4"
'abc\xe4'
>>> print "abc\xe4"
abcä
>>> "abc\xe4".encode("latin-1")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeError: ASCII decoding error: ordinal not in range(128)
Warum ASCII-Decoding error, ich habe doch latin-1 angegeben?
Ich hätte erwartet, das der String unverändert rauskommt.
--
Mit freundlichen Grüßen
Klaus Meyer :-)
More information about the Python-de
mailing list