goldtech, 30.11.2010 22:15:
Think I found it, for example:

line = 'my big string'
line.encode('ascii', 'ignore')

I processed the problem strings during parsing with this and it works
now.

That's not the right way of dealing with encodings, though. You should open the file with a well defined encoding (using codecs.open() or io.open() in Python >= 2.6), and then write the unicode strings into it just as you get them.

Stefan

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

Reply via email to