Sample code for 30+ languages & platforms
DataFlex

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoHttp
    String s
    String sEncoded
    String sDecoded

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Move "Hello World! 100% sure." To s

    Get ComUrlEncode Of hoHttp s To sEncoded
    Showln "URL encoded: " sEncoded

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

    Get ComUrlDecode Of hoHttp sEncoded To sDecoded
    Showln "URL decoded: " sDecoded

    // Output:

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


End_Procedure