UnicodeError

Kristian Ovaska kristian.ovaska at helsinki.fi
Mon Apr 30 10:58:08 EDT 2001


Oliver Vecernik <vecernik at aon.at>:
>    df.write('DROP TABLE %s;\n' % daoDB.TableDefs(t).Name)
>UnicodeError: ASCII encoding error: ordinal not in range(128)

Try daoDB.TableDefs(t).Name.encode('ISO-8859-1') if you use Python 2.
(If Name is not a string, convert it to string first.) I had similar
problems with XML files that have non-ASCII content and this solved
some of them. I still haven't sorted everything out, though.

-- 
Kristian Ovaska <kristian.ovaska at helsinki.fi>



More information about the Python-list mailing list