python字符串的decode()和encode()
来源:互联网 发布:罗马2画面优化补丁 编辑:程序博客网 时间:2024/05/17 22:25
字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。
decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串str1转换成unicode编码。
encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode('gb2312'),表示将unicode编码的字符串str2转换成gb2312编码。
- python字符串的decode()和encode()
- python字符串的encode和decode
- python的decode和encode
- python的decode和encode
- python 的encode和decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- Python字符串的encode与decode
- 索引基本管理
- SQL基础
- Java文件操作
- arc使用非arc 非arc使用arc
- HLA和OOAD相关概念和区别
- python字符串的decode()和encode()
- 'SVN更新' has encountered a problem :An internal error occurred during: svn错误
- 快速解决Win 7升级后无法正常进入睡眠模式的问题——386w.com
- 几种常用加密算法比较
- 学习asp.net比较完整的流程
- 最大流 EK算法详解
- 图像处理方向常用网站
- Vladimir Putin has issued a blunt warning against Syrian rebels
- 重定义对象简易总结