+ 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?

25th Apr 2022, 12:46 PM
Kind_Cat
Kind_Cat - avatar
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
25th Apr 2022, 2:15 PM
Lothar
Lothar - avatar
+ 2
Perhaps it would be better if you provide the code itself?
25th Apr 2022, 12:58 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 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.
25th Apr 2022, 1:04 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 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?
25th Apr 2022, 1:49 PM
Lothar
Lothar - avatar
+ 1
Do you think that Russian symbols are not in Unicode?
25th Apr 2022, 1:05 PM
Kind_Cat
Kind_Cat - avatar
+ 1
No, that's not that, I tried
25th Apr 2022, 1:08 PM
Kind_Cat
Kind_Cat - avatar
0
Lothar When I am trying to read this file (f.read())
25th Apr 2022, 1:49 PM
Kind_Cat
Kind_Cat - avatar