Issue with UTF-/ encoding on csv file for excel

前端 未结 3 1940
傲寒
傲寒 2020-12-17 04:39

EDIT:

As suggested special chars are displayed correctly if I use notepad++ to open the csv file. They are displayed correctly too when I import the csv file into

3条回答
  •  被撕碎了的回忆
    2020-12-17 04:56

    In python3 I just do this:

    with open(file, "w+", encoding='utf-8-sig') as f:
                    f.write("Vérification")
    

    Pretty simple, right? :) You can search "utf-8-sig" in the python docs

提交回复
热议问题