fhand = open("text.txt") for line in fhand: print(line) In the text.txt file the word " hello ". When you run the script, the output in the console: " R ± P" С‚С, С ". Cyrillic is displayed normally in the terminal itself. Also, the usual print (' Hello ') command displays " Hello " in the terminal. Why does the encoding break when reading Cyrillic from a file, and how can I fix it? UTF-8 terminal encoding
fhand = open("text.txt", encoding='utf-8')- insolorlocale.getpreferredencoding()). - insolor