#!/usr/bin/python
# -*- coding: UTF-8 -*-
在python2中测试
i = '中国'
print [i.decode('utf-8')] #16进制
gbk = i.decode('utf-8').encode('GBK') #utf-8转gbk
# print i.decode('GBK').encode('utf-8') #utf-8转gbk
print gbk.decode('GBK').encode('utf-8')
print gbk.decode('GBK').encode('gb2312')
字符编码