i'm trying to check if some strings are in one array, like this:
intact_columns = [...]
for key, value in obj.iteritems():
if not key in intact_columns:
The issue is because you are using the different encoding in both the strings. I am not the sure about the encoding type. It is safe to decode these to
utf-8 (or utf-16) and then check. For example:
>>> my_list = ['Reten\xc3\xa7\xc3\xa3o (RET)', 'blah blah ...'] >>> my_string = 'Retenção (RET)' >>> my_list.decode('utf-8') u'Reten\xe7\xe3o (RET)' >>> my_string.decode('utf-8') u'Reten\xe7\xe3o (RET)'
Both holds the same decoded value