Sample code for 30+ languages & platforms
PowerShell

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$http = New-Object Chilkat.Http

$s = "Hello World! 100% sure."

$encoded = $http.UrlEncode($s)
$("URL encoded: " + $encoded)

# Space → %20
# ! → %21
# % → %25

$decoded = $http.UrlDecode($encoded)
$("URL decoded: " + $decoded)

# Output:

# URL encoded: Hello%20World%21%20100%25%20sure.
# URL decoded: Hello World! 100% sure.