Jun-27-2018, 09:14 AM
The usage of what @buran link to.
uni_hello = 'hello Χαίρετε добры дзень 여보세요' with open('uni_hello.txt', 'w', encoding='utf-8') as f_out: f_out.write(uni_hello) with open('uni_hello.txt', encoding="utf-8") as f: print(f.read())
Output:hello Χαίρετε добры дзень 여보세요
A couple of advice when all fails. with open('some_file', encoding='utf-8', errors='ignore') as f: with open('some_file', encoding='utf-8', errors='replace') as f:ftfy fixes Unicode that’s broken in various ways.