15 years later, I finally found the solution: write CSV in UTF-16-LE
without BOM
, and it will work on Excel 2007+.
Example with Python:
import csvwith open('test.csv', "w", encoding="utf-16-le", newline='') as csvfile: w = csv.writer(csvfile, delimiter=';') w.writerow(["abc", "def"]) w.writerow(["été", "hiver"])
The output CSV file can be opened directly with Excel, and:
- (1) no problems with the accents
- (2) the delimiters will be automatically parsed into multiple columns
Note: if using encoding="utf-16"
instead of utf-16-le
, (1) will still be ok, but not (2).