实现URL编码解码的python程序
#!/usr/bin/python解码使用unqute和decode函数
import urllib
import sys
string = sys.argv[1]
string = unicode(string,"gbk")
utf8_string = string.encode("utf-8")
gbk_string=string.encode("gbk")
gbk=urllib.quote(gbk_string)
utf8=urllib.quote(utf8_string)
print gbk
print utf8
相关文档(Relevant Entries)
Posted on April 13, 2007 8:35 PM
| Permalink | | | TrackBacks (0)
TrackBack URL for this entry:
http://www.wujianrong.com/mt-tb.cgi/5019
http://www.wujianrong.com/mt-tb.cgi/5019