摘要: 当使用Python编程时,编码问题一直很让人头疼,程序中经常会碰到如下错误提示: UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position 1: ordinal not in range(128) 这是由于python在 阅读全文
posted @ 2017-08-25 20:33 xqnq2007 阅读(12095) 评论(0) 推荐(0)
摘要: s = "图片picture"print chardet.detect(s) for c in s.decode('utf-8'): print c UnicodeEncodeError: 'ascii' codec can't encode character u'\u5728' in posit 阅读全文
posted @ 2017-08-25 20:17 xqnq2007 阅读(1110) 评论(0) 推荐(0)