可能重复:
Open a file in the proper encoding automaticallyCSV不同编码
我的代码:
import csv
def handle_uploaded_file(f):
dataReader = csv.reader(f, delimiter=';', quotechar='"')
for row in dataReader:
do_sth
的问题是,它也只能如果CSV是UTF-8编码。我应该更改什么来提供iso-8859-2或windows-1250编码? (最好的解决方案是自动识别编码,但手动转换也是可以的)
http://stackoverflow.com/q/2342284/624829 – Boud