Chilkat2-Python
Chilkat2-Python
URL Encoding and Decoding
Demonstrates URL encoding/decoding using the HTTP convenience methods.Chilkat Chilkat2-Python Downloads
import chilkat2
http = chilkat2.Http()
s = "Hello World! 100% sure."
encoded = http.UrlEncode(s)
print("URL encoded: " + encoded)
# Space → %20
# ! → %21
# % → %25
decoded = http.UrlDecode(encoded)
print("URL decoded: " + decoded)
# Output:
# URL encoded: Hello%20World%21%20100%25%20sure.
# URL decoded: Hello World! 100% sure.