1
votes

I am using the Django csv import (https://pypi.python.org/pypi/django-csvimport) to populate some models. The problem is the csv files I have are encoded in ANSI (Windows-1252) format and they have words with special characters e.g. JOSÉ, when I import to my models the word become JOSи.

Could you help me with this?

P.S.:

1 - I have fulfilled the encoding field of the csv import with many options (ansi, utf-8...) but it seems to have no effect.

2 - I have tried to convert my csv files to many differents formats (using vb.net) like utf-8, utf-32, unicode... but all of them cause some error in Django csv import.

1

1 Answers

1
votes

After some tries I found the solution: While trying to convert my text file using vb.net I was opening it with OpenText(), which open the file with UTF8 encoding. So I opened it with something like "Using SR As StreamReader = New StreamReader(Fl.FullName, System.Text.Encoding.GetEncoding("Windows-1252"), True)", and wrote it with UTF8. This solved the problem.