#!/usr/bin/env python
# _*_ coding:utf-8 _*_
from urllib.request import urlopen
testPage=urlopen("http://www.pythonscraping.com/pages/warandpeace/chapter1.txt")
#把字符串转变为utf-8编码
print(str(testPage.read(),'utf-8'))
#将字符转为Unicode编码
#content=bytes(content,'UTF-8')将字符串转变为字节对象
#content=content.decode('UTF-8')将字节对象从utf-8编码改变为Unicode编码的字符串