Sorry if this isn't a reproducible example but I am guessing someone will know what to do when I describe the problem. The problem I have is that I am getting characters like "\xe2" "\x80" from a txt file that I am reading in the following way:
words = open("directory/file.txt","r")
liness = []
for x in words.readlines():
liness.append(lines.rstrip('\n'))
When I print lines I get the list I want, but then when I use max() in the following way:
max(liness, key = len)
returns the "a line from file.txt that containts \xe2 and \x80"
I know this probably has something to do with encoding, but I haven't had luck solving it. Anyone?