笔记

  1. python脚本开头第一行或者第二行指定编码 # coding=”utf-8” 否则可能导致字符串里出现的非ASCII编码报错
  2. 转码
b = '我是gbk编码'
print b.decode('gbk')
b.decode('gbk').encode('utf-8')

参考资料

python/python的编码.txt · 最后更改: 2008/09/14 04:28 由 58.31.68.160
到顶部
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0 红麦软件 红麦软件