Sample code for 30+ languages & platforms
Xbase++

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat Xbase++ Downloads

Xbase++
LOCAL oHttp
LOCAL s
LOCAL cEncoded
LOCAL cDecoded

oHttp := CreateObject("Chilkat.Http")

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

cEncoded := oHttp:UrlEncode(s)
? "URL encoded: " + cEncoded

//  Space → %20
//  ! → %21
//  % → %25

cDecoded := oHttp:UrlDecode(cEncoded)
? "URL decoded: " + cDecoded

//  Output:

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

oHttp:destroy()