返回顶部

收藏

Built-in function unicode() provides access to all registered Unicode codecs

更多
#Built-in function unicode() provides access to all registered Unicode codecs 
#(COders and DECoders). 

#Some of the more well known encodings which these codecs can convert are Latin-1, 
#ASCII, UTF-8, and UTF-16. 

 #The latter two are variable-length encodings that store each Unicode character in 
#one or more bytes. The default encoding is normally set to ASCII, which passes 
#through characters in the range 0 to 127 and rejects any other characters with an 
#error. When a Unicode string is printed, written to a file, or converted with 
#str(), conversion takes place using this default encoding.

print u'abc'

print str(u'abc')

print u'\0102'

print str(u'\0104')

标签:Python,基础

收藏

0人收藏

支持

0

反对

0

相关聚客文章
  1. 博主 发表 2014-08-23 13:10:00 Python基础05 条件判断和循环
  2. 博主 发表 2014-09-13 04:10:00 Python基础06 函数
  3. 博主 发表 2014-02-21 16:00:00 Python基础入门
  4. 博主 发表 2014-10-05 02:10:00 Python基础07 切片
  5. the5fire 发表 2016-10-13 13:11:04 Python基础看完了?来两本进阶书
  6. 博主 发表 2014-01-22 00:00:00 零基础学习python与selenium webdriver
  7. Adoo 发表 2012-05-02 09:12:00 Python 基础入门笔记(4)
  8. 大象会跳舞 发表 2017-06-06 02:02:26 Python 学习 | 基础篇
  9. Adoo 发表 2012-05-03 08:05:00 Python 基础入门笔记(5)
  10. 博主 发表 2014-12-04 13:10:51 Python标识符、保留字符
  11. learnhard 发表 2014-01-09 05:57:05 [原创]Python基础知识小结(1)
  12. itxuye 发表 2015-09-10 14:54:08 python基础入门的坑

发表评论