#coding:utf-8
import urllib
s={"username":"hhh","password":"XXXX"}
#urllib.urlencode url编码
s=urllib.urlencode(s)
print s
s_encode=urllib.unquote("username=hhh&password=XXXX")
#urllib.unquote url解码
s0="url=http%3A%2F%2Ftest_m.imoodou.com%2F%2Fqukan_new2%2Fdest%2Ffeedback%2Fhtml%2Ffeedback%2Ffeedback.html%3Fdev%3D7%26id%3D4%26tagId%3D401%26vn%3D3.1.5.400-debug%26v%3D30105400&msg=%E9%BB%98%E9%BB%98%E5%93%A6%E6%91%B8%E6%91%B8%E5%93%A6%E5%93%A6%E5%93%A6%F0%9F%98%84"
s1=urllib.unquote(s0)
print s1

05-22 10:45