Comment

Comment by abus

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')
parent abus 12 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton