[问题]中文字串 ascii编码问题

楼主: pig98520 (CheinFeng)   2019-03-04 17:35:06
大家好,最近爬虫时遇到一个问题,
爬虫爬下来的字串为str1,存到SQL后的字串为str2,
但当我select下来比对后,发现两者字串不相符,
比对ascii code后发现这样的问题:
https://imgur.com/FkZmLGh
想问一下为何会发生这样的问题?有解决的方法吗..QAQ
作者: shala (沙罗)   2019-03-04 17:41:00
CJK Compatibility Ideographs。解决方法我想只能自己转换
作者: Raymond0710 (雷门)   2019-03-05 00:53:00
unicodedata.normalize('NFKD', '\uf90a' )=='\u91d1
楼主: pig98520 (CheinFeng)   2019-03-05 10:59:00
感谢两位大大,已经顺利解决了~

Links booklink

Contact Us: admin [ a t ] ucptt.com