python 解码js escape,encodeURI

 

import urllib2


urls="%cc%ab%d1%f4%b5%c4%d0%c2%c4%ef"    //encodeuri编码(gbk)
url="%E4%B8%AD%E6%96%87"  //encodeuri编码(utf-8)
word="%u4e0a%u6d77%u738b" //escape编码

 

"\u4e0a\u6d77\u738b".decode('unicode_escape').encode('utf-8')

urllib2.unquote(urls).decode("gbk")

urllib2.unquote(url).decode("utf-8")

 

你可能感兴趣的:(c,python,url,import)