News for hackers. Stuff that matters.
Re:Unicode in Python 3 by abus on Tuesday May 13, 2014 @01:25PM (#7739380)
I've used the Py2 csv module with csv files containing accented characters and had no issues. Could you post an example?

This works fine, as does the corresponding writer:

    reader = csv.reader(open(FILENAME, 'rb'))
    for row in reader:
        print row
If you want a unicode string it's as simple as:

    value = row[0].decode('utf8')
Then before writing:

    row[0] = value.encode('utf8')

There are no comments on this comment yet.