Created
August 27, 2018 18:28
-
-
Save rg3915/81004be5338ab60dd9d899298c77608f to your computer and use it in GitHub Desktop.
urlencode Python 2 to HTML
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
urlencode Python 2 to HTML | |
from urllib import quote_plus | |
from urllib import urlencode | |
name = request.GET.get('name') | |
email = request.GET.get('email') | |
urlencode({ | |
'name': name.encode('utf-8'), | |
'email': email.encode('utf-8'), | |
}) | |
# 'name=R%C3%A9gis&[email protected]' | |
# ou | |
quote_plus(name.encode('utf-8')) | |
# 'R%C3%A9gis' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment