I want to check that if the argumant s of function f1(s) receives some strings (that are in UTF8 ) in MyList then call function f2; But I cannot compare strings correctly.
def f1( s ):
MyList = [ u"نامشخص".encode("utf-8") , u"Unknow".encode("utf-8")]
for t in MyList:
if( t == s.encode('utf-8') ):
f2()
return None
break
else:
print t , " =?=" , s.encode("utf-8")
print len(t), " =?=" , len(s)
return s
Aucun commentaire:
Enregistrer un commentaire