I have this piece of code in python:
def write_to_log_file(text):
with open ("C:\Users\Administrator\Desktop\log.txt",mode='w') as file:
file.write(text)
however when I run this code I am getting the following error:
line 13, in write_to_log_file
file.write(text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 126: ordinal not in range(128)