Svennglenn> Traceback (most recent call last):
    Svennglenn>   File "D:\Documents and
    Svennglenn> 
Settings\Daniel\Desktop\Programmering\aaotest\aaotest2\aaotest2.pyw",
    Svennglenn> line 5, in ?
    Svennglenn>     titel = unicode(titel)
    Svennglenn> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in 
position 0:
    Svennglenn> ordinal not in range(128)

Try:

    import codecs

    titel = "åäö"
    titel = unicode(titel, "iso-8859-1")
    fil = codecs.open("testfil.txt", "w", "iso-8859-1")
    fil.write(titel)
    fil.close()

Skip
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to