Today I had to handle a csv file upload with django, parse it with a csv.DictReader and cycle on results.
I first thought this could be easily accomplished with the csv python module, but the task turned itself into a big pain in the a**, due to characters encoding and csv dialects Babylon.
After a bit of googling, I solved the issue thanks to a couple of very nice blog posts and the chardet python module. (http://pypi.python.org/pypi/chardet)
Here is what i did:
import chardet def handle_upload(request) #assuming 'uploaded_file' is the file key in ...