Python unicode equal comparison failed -
this question linked searching unicode characters in python i read unicode text file using python codecs codecs.open('story.txt', 'rb', 'utf-8-sig') and trying search strings in it. i'm getting following warning. unicodewarning: unicode equal comparison failed convert both arguments unicode - interpreting them being unequal is there special way of unicode string comparison ? you may use == operator compare unicode objects equality. >>> s1 = u'hello' >>> s2 = unicode("hello") >>> type(s1), type(s2) (<type 'unicode'>, <type 'unicode'>) >>> s1==s2 true >>> >>> s3='hello'.decode('utf-8') >>> type(s3) <type 'unicode'> >>> s1==s3 true >>> but, error message indicates aren't comparing unicode objects. comparing unicode object str object, so: >>> u'hello' =...