Hands-on task
URL-encode a string
The string in /root/query.txt (name=John Doe&city=São Paulo) needs to be safely embedded in a URL. Perform percent-encoding (URL-encoding) of this string — spaces, &, = and non-ASCII characters must become %XX — and write the result to /root/encoded.txt.
- url-encoding
- percent-encoding
- python3
- urllib.parse
- character encodings