Python中的字符编码的使用

使用实例:

htmlsourse=unicode(urllib.urlopen(url).read(),"gb2312","ignore").encode("utf-8","ignore")  # 先转为 unicode 码 再进行 utf-8 编码
posted @ 2011-01-30 16:42  软践  阅读(172)  评论(0编辑  收藏  举报