Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 324 Bytes

README.md

File metadata and controls

14 lines (11 loc) · 324 Bytes

zhurl

中文域名、URL的punycode互转。

##使用方法

下载zhurl.py到引用它的脚本的工作目录下。

import zhurl
>>> zhurl.encode_url(u'http://www.李嘉诚.com/')
u'http://www.xn--w4rt51b8s1a.com/'
>>> print zhurl.decode_url(u'http://www.xn--w4rt51b8s1a.com/')
http://www.李嘉诚.com/