随笔分类 - python中文处理
在Unicode和普通字符串之间转换
摘要:2008-04-20 02:04:51 by deepblue 原文出处:http://group.movo.tv/m8/circlediarylook/S4028808a148b0dec01148b9d5e4c02e4.html 1.1. 问题 Problem You need to deal with data that doesn't fit in the ASCII character ...
阅读全文
Python字符串的encode与decode
摘要:首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串转换成unicod...
阅读全文
浙公网安备 33010602011771号