您的当前位置:首页正文

UnicodeWarning: Unicode equal co

来源:华拓网

简而言之,在python中对中文的匹配,如果采用Unicode编码:

u'Hello' == 'Hello'
True
u'Hello' == '\x81\x01'
main:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
False