Use
but outside stuff like files(use utf-8),Os,Editors...
When moved to Python 2 to 3 Unicode was one biggest changes.
Example file saved as utf-8:
utf-8
both when read and write file,usually now these days is Python not the problem,but outside stuff like files(use utf-8),Os,Editors...
When moved to Python 2 to 3 Unicode was one biggest changes.
Example file saved as utf-8:
some.csv
Output:administrator’s, Mac
Boat, ⚓️
Rain, ☂️
はるさんハウスはどこですか, jap
import csv with open('some.csv', newline='', encoding='utf-8') as f, open('out.csv', 'w', encoding='utf-8') as f_out: reader = csv.reader(f) writer = csv.writer(f_out) for row in reader: print(row[0], row[1]) writer.writerow(row)
Output:administrator’s Mac
Boat ⚓️
Rain ☂️
はるさんハウスはどこですか jap
In out.csv
:Output:administrator’s, Mac
Boat, ⚓️
Rain, ☂️
はるさんハウスはどこですか, jap