I am downloading and saving in a CSV data using Django but I have problems when the text is not a simple string but Unicode.
This is what I do:
writer = csv.writer(response)
writer.writerow(tuple(corresponding_data[btn]["columns"].split(',')))
for row in rows:
writer.writerow(row)
return response
How can I also include unicode text?
EDITED
This is the error I get:
'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
And if I try this:
writer = csv.writer(response, encoding='utf-8')
I get an error that 'encoding' parameter doesn't exist in this function.