How to use UTF-8 in Python
来源:互联网 发布:360杀毒mac版靠谱吗 编辑:程序博客网 时间:2024/05/20 19:30
http://stackoverflow.com/questions/6289474/working-with-utf-8-encoding-in-python-source
In source header you can declare:
#!/usr/bin/env python# -*- coding: utf-8 -*-....
It is described in the PEP 0263:
Then you can use UTF-8 in strings:
#!/usr/bin/env python# -*- coding: utf-8 -*-u = 'idzie wąż wąską dróżką'uu = u.decode('utf8')s = uu.encode('cp1250')print(s)
0 0
- How to use UTF-8 in Python
- How to Use UTF-8 with Python python中使用utf-8
- How to use FTP in Python
- How to use urllib2 in Python
- How to use SET in python
- how to use pandas in python
- [Python]How to use magic methods in Python?
- How to use UTF-8_with_BOM, XML and Java together
- How to use *args and **kwargs in Python
- How to use *args and **kwargs in Python
- [Python] How to use Pyramid?
- How to use Serial Port in Windows
- How To Use Macro In Program.
- How to use virt-install in OpenSolaris
- How to use tinyfck in drupal
- How to use Regular Expression in LotusScript
- How to Use PeekMessage() Correctly in Windows
- How to use IMGDECMP.DLL in WindowsCE
- gson(随笔)
- sqlmap无法更新解决办法
- 清除 Linux 登陆信息及日志
- sql 交叉查询
- [Java]深入理解Java Class文件格式(二)
- How to use UTF-8 in Python
- centos linux ntfs 挂载
- struts2中根对象以及ognl
- 移动应用常用的布局方式
- 常州seo学习说说关键词拓展的15个要素
- 毕业10年的程序员
- android中layout_weight属性分析
- 使用SQL BAK Reader 小工具查看SQL Server备份文件内容(不需要打开SQL Server)
- 视频监控系统(tq2440 + zc301)