Created
July 18, 2019 10:16
-
-
Save daniellowtw/5b8613d2f6bcee44af9fb6727c5c33df to your computer and use it in GitHub Desktop.
Encoding url
This file contains 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
#Python3 | |
urlencode() { | |
python -c "import urllib.parse as ul; print(ul.quote_plus('$1'));" | |
} | |
#Python2 | |
urlencode() { | |
python -c "import urllib as ul; print(ul.quote_plus('$1'));" | |
} | |
#Node | |
urlencode() { | |
node -e "console.log(encodeURI('$1'))" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment