Created
June 17, 2012 03:01
-
-
Save PyYoshi/2943263 to your computer and use it in GitHub Desktop.
urlencodeされたqueryを連想配列に戻す関数 ref: http://qiita.com/items/115d1f3bff23bafb36a2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding:utf8 | |
| import urllib | |
| def urldecode(s): | |
| rdic = {} | |
| for item in s.split('&'): | |
| keyVal = item.split('=') | |
| rdic[urllib.unquote_plus(keyVal[0])] = urllib.unquote_plus(keyVal[1]) | |
| return rdic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment