python字符编码判断



isinstance(s, str) 用来判断是否为一般字符串

isinstance(s, unicode) 用来判断是否为unicode

if type(str).__name__!="unicode":

你可能感兴趣的:(python字符编码判断)