C#
C#
URL Encoding and Decoding
Demonstrates URL encoding/decoding using the HTTP convenience methods.Chilkat C# Downloads
Chilkat.Http http = new Chilkat.Http();
string s = "Hello World! 100% sure.";
string encoded = http.UrlEncode(s);
Debug.WriteLine("URL encoded: " + encoded);
// Space → %20
// ! → %21
// % → %25
string decoded = http.UrlDecode(encoded);
Debug.WriteLine("URL decoded: " + decoded);
// Output:
// URL encoded: Hello%20World%21%20100%25%20sure.
// URL decoded: Hello World! 100% sure.