0

Using python 2, I'm unable to detect if my unicode string is detected in a list, set, or dictionary.

For example I'm generating the list by iterating through file names

res = []
for root, dir, file in os.walk('./'):
    for name in file:
        res.append(name.replace('/', '_'))

One of the file's name is Município

When I print the item out I get Munici\xcc\x81pio. That's not an issue, but when I try to check if Município is in the list, it returns false. I check if both are unicode and they are.

user3145912
  • 131
  • 1
  • 15

0 Answers0