+ 1
UnicodeDecodeError
I wrote the code on Python and saved it to file and after that I tried to read this file using Python IDLE 3.10 and I got an UnicodeDecodeError. Can somebody tell me, how to fix it?
8 Answers
+ 3
👑 Prometheus 🇸🇬 ,
the russian text or even python identifiers in foreign languages are not a problem since python 3.0.
you can find more information about that reading:
(2.3. Identifiers and keywords)
https://docs.python.org/3/reference/lexical_analysis.html#identifiers
+ 2
Perhaps it would be better if you provide the code itself?
+ 2
From what I can see there is Russian text in the code (I cannot run the code since it uses Tkinter), but from this, I think the Russian input is the cause of error.
+ 2
Kind_Cat ,
i have been starting the code in pydroid inside a sandbox, i did not get an error. so when exactly does the error occur?
+ 1
Do you think that Russian symbols are not in Unicode?
+ 1
No, that's not that, I tried
0
Lothar When I am trying to read this file (f.read())