Sample code for 30+ languages & platforms
Node.js

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var http = new chilkat.Http();

    var s = "Hello World! 100% sure.";

    var encoded = http.UrlEncode(s);
    console.log("URL encoded: " + encoded);

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

    var decoded = http.UrlDecode(encoded);
    console.log("URL decoded: " + decoded);

    //  Output:

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

}

chilkatExample();