python中文处理
来源:互联网 发布:英格兰长弓手—指算法 编辑:程序博客网 时间:2024/04/30 11:53
# -*- coding:utf-8 -*-
制定编码为utf-8
出现 UnicodeDecodeError: 'utf8' codec can't decode byte 0xa1 in position 0: invalid start byte
可以用
str = unicode(str, errors='replace')
or
str = unicode(str, errors='ignore')
直接将文字替换掉 前提是文字是不需要的获得系统的默认编码
import sys
print sys.getdefaultencoding()
0 0
- python中文处理
- python中文字符串处理
- Python的中文处理
- ZZ python处理中文
- [转贴]:Python中文处理
- python中文处理
- Python的中文处理
- python处理中文字符
- python中文处理
- Python:中文处理小结
- Python:中文处理攻略
- Python处理中文路径
- python中文处理
- Python的中文处理
- python 处理中文Excel
- Python处理中文
- Python 中文处理
- Python的中文处理
- android移动view
- LoadRunner函数大全
- myeclipse 启动weblogic 报错
- 珠宝网站 裸钻列表数据加载不出来
- WPF 数字框实现
- python中文处理
- static_cast 与reinterpret_cast
- 12周项目5
- 17周项目二,4,(指针做形参) .
- hypervisor&VDI_IN_A_BOX
- Oracle中的Union、Union All、Intersect、Minus
- mysql中key 、primary key 、unique key 与index区别
- 迭代器模式(Iterator pattern)
- JS动态调用方法名