Do you also get weird signs like ‘\x00s\x00v\x00e\x00n\x00l\x00o’ when reading data from file?
It’s because UTF-16 encoding. You should decode it. Here’s the solution:
import codecs filename = 'yourFileName.txt' with codecs.open(filename, "r", "utf-16") as f: data = f.read().splitlines() print(data)