navigation
索引
Home
apps
database
html
iis
java
js
linux
lucene
nicewords
php
playground
python
作为服务器shell
抓取与正则
find_webshell
gtalk机器人
mod_python
msn机器人
mysqldb
python文件绝对路径
python的编码
python-memcached
python_as_shell
start
vim
zlib
ror
search
svn
team
tech
user
wiki
红麦软件
lunece
start
搜索
创建文章
toolbox
索引
最近更改
反向链接
登录
python:python的编码
TechWiki
显示源文件
修订记录
BackLink
您的足迹:
»
tomcat安装
»
start
»
php开发框架
»
start
»
sqlite
»
start
»
python_as_shell
»
start
»
server_status
»
python的编码
您在这里:
start
»
python
»
python的编码
笔记
python脚本开头第一行或者第二行指定编码 # coding=”utf-8” 否则可能导致字符串里出现的非ASCII编码报错
转码
b =
'我是gbk编码'
print
b.
decode
(
'gbk'
)
b.
decode
(
'gbk'
)
.
encode
(
'utf-8'
)
参考资料
http://wiki.woodpecker.org.cn/moin/PyEnCode
http://wiki.woodpecker.org.cn/moin/PyInChinese
python/python的编码.txt · 最后更改: 2008/09/14 04:28 由 58.31.68.160
到顶部