python 3.x - Dictionary utf-8 encoding -
i have saved dictionary on txt file(its written in greek language):
{'Μπαρτσελόνα': 'Μπαρτσελόνα', 'Οβιέδο': 'Οβιέδο'}
then trying open python:
g = open('dic.txt','r', encoding='utf-8') dic2 = eval(g.read()) g.close()
but error message:
':'Όσιγιεκ','Ζάπρεσιτς':'Ίντερ Ζάπρεζιτς','Σερφίφ':'Σερίφ Τίρασπολ','Μορεϊρένσε':'Μορειρένσε','Κλουζ':'ΚΦΡ Κλουζ', ^ syntaxerror: invalid character in identifier
is there problem encoding?
Comments
Post a Comment