UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
with open('F:\Temp\python\matches-details.csv', 'w') as output_file:
dict_writer = csv.DictWriter(output_file, keys)
dict_writer.writeheader()
dict_writer.writerows(matches_details)
print("file created")
I edited the code to be:
with open('F:\Temp\python\matches-details.csv', 'w',encoding='utf-8) as output_file:
dict_writer = csv.DictWriter(output_file, keys)
dict_writer.writeheader()
dict_writer.writerows(matches_details)``
print("file created")
but the text in my csv file become as this: (Ø§Ù„ÙØ±ÙŠÙ‚ الأول)