Laszlo Nagy napisaĆ(a): > This program > > fin = codecs.open(fname,"r",encoding="UTF-8") > eader = csv.DictReader(fin) > for values in reader: > pass > > results in: > > File "run.py", line 23, in process_file > for values in reader: > File "/usr/local/lib/python2.5/csv.py", line 83, in next > row = self.reader.next() > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in > position 13: ordinal not in range(128) > > As you can see the exception is thrown in csv.py. How it is possible? > The csv.DictReader should not use ascii codec for anything, because the > file encoding is UTF-8.
Reader works with byte strings, not unicode objects. -- Jarek Zgoda Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101 "We read Knuth so you don't have to." (Tim Peters) -- http://mail.python.org/mailman/listinfo/python-list