2013年3月5日
摘要: 1. str的decode与encode成员方法str.decode : other encoding-> utf16str.encode : utf16 -> other encoding2. 文件编码与字符串在内存中的表示形式文件编码同字符串在内存中的编码相同。例如:,程序运行后,结果如下:1#coding:utf823u1='你好'.decode('gbk')4u2='你好'.decode('utf8')5printu16printu2文件编码为 utf8浣犲ソ你好注意:1. 文件时utf8编码;2. u1以gb 阅读全文
posted @ 2013-03-05 09:41 sanlo 阅读(355) 评论(0) 推荐(0) 编辑