I have a file that hungarian and I want to modify it by code, but there is problem with it. Here is my simple code:
f = open('nametext','r') text=f.read() print(text) f.close() the nametext file contains the following strings:
Bevallás iparűzési adófeltöltési kötelezettségről 2013 Gépjárműadó-kedvezmény mentesség bevallás 2013 Helyi iparűzési adóbevallás 2013 Idegenforgalmi adóbevallás 2013 Kommunális adóbevallás 2013 Talajterhelési díj bevallás 2013 And I have got an error message, what is the following:
Traceback (most recent call last): File "python", line 2, in <module> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 6: invalid continuation byte The position 6 is the 7th character int the text what is an hungarian letter: ű
How to compile it? I have compiled the file at repl.it. I have almost the same problem with Ruby. There is a problem with text coding, but I still have not solution.