001_023 Python 对Unicode数据编码并应用于XML和HTML
来源:互联网 发布:手机上写代码的软件php 编辑:程序博客网 时间:2024/06/05 19:59
代码如下:
#encoding=utf-8print '中国'#对Unicode数据编码并应用于XML和HTML#解决方案def encode_for_xml(udata,encoding='ascii'): return udata.encode(encoding,'xmlcharrefreplace')print encode_for_xml(u'中国')
打印结果如下:
中国
中国
0 0
- 001_023 Python 对Unicode数据编码并应用于XML和HTML
- Python编码和Unicode
- Python编码和Unicode
- Python编码和Unicode
- 【Python】Python编码和Unicode
- python 编码unicode 和 str
- java对unicode的编码 和 解码
- Python 编码问题 utf-8 和 unicode
- Python 编码问题 utf-8 和 unicode
- python中的unicode和str编码
- python编码(str和unicode)
- python 编码转换 unicode和encode作用
- python中编码unicode和utf-8
- Python编码和Unicode(转)
- ASP.NET对数据进行HTML编码将其绑定到DrowdownList并解码的解决方案
- python中的unicode编码
- python 学习~unicode 编码
- python 的unicode编码
- Gas Station
- android开场动画splash的实现
- 模拟退火
- 深入理解模拟退火算法(Simulated Annealing)
- 大白话解析模拟退火算法
- 001_023 Python 对Unicode数据编码并应用于XML和HTML
- XMind简单应用_《算法》目录
- 仿微信朋友圈点击图片变暗
- 模拟退火算法总结(含例子)
- 3.5 模拟退火算法
- 植树节
- 行为树(Behavior Tree)
- Evaluate Reverse Polish Notation -- LeetCode
- ASP.NET的最强大数据显示控件ListView