Thomas Heller wrote:
It seems also the error messages aren't too helpful:
"ä".encode("latin-1")
Traceback (most recent call last): File "<stdin>", line 1, in ? UnicodeDecodeError: 'ascii' codec can't decode byte 0x84 in position 0: ordinal not in range(128)
Hm, why does the 'encode' call complain about decoding?
Because it tries to print it out to your console and fail. While writing to the console it tries to convert to ascii.
Beside, you should write:
u"ä".encode("latin-1") to get a latin-1 encoded string.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list