function Encoder() {
}

Encoder.prototype.encodeHTML = function(str) {
    var encoded = this.encodeHTMLAttr(str);
    encoded = encoded.replace(/>/g, '&gt;');
    encoded = encoded.replace(/ /g, '&nbsp;');

    return encoded;
};

Encoder.prototype.decodeHTML = function(str) {
    var decoded = '';

    if (str === undefined || str.length === 0) {
        return decoded;
    }

    decoded = str.replace(/&amp;/g, '&');
    decoded = decoded.replace(/&lt;/g, '<');
    decoded = decoded.replace(/&#39;/g, '\'');
    decoded = decoded.replace(/&quot;/g, '"');
    decoded = decoded.replace(/&gt;/g, '>');
    decoded = decoded.replace(/&nbsp;/g, ' ');

    return decoded;
};

Encoder.prototype.encodeHTMLAttr = function(str) {
    var encoded = '';

    if (str === undefined || str.length === 0) {
        return encoded;
    }

    encoded = str.replace(/&/g, '&amp;');
    encoded = encoded.replace(/</g, '&lt;');
    encoded = encoded.replace(/\'/g, '&#39;');
    encoded = encoded.replace(/"/g, '&quot;');

    return encoded;
};

Encoder.prototype.decodeHTMLAttr = function(str) {
    var decoded = '';

    if (str === undefined || str.length === 0) {
        return decoded;
    }

    decoded = str.replace(/&amp;/g, '&');
    decoded = decoded.replace(/&lt;/g, '<');
    decoded = decoded.replace(/&#39;/g, '\'');
    decoded = decoded.replace(/&quot;/g, '"');

    return decoded;
}

Encoder.prototype.encodeJavaScript = function(str) {
    //TODO
};

Encoder.prototype.encodeURI = function(str) {
    return encodeURI(str);
};

Encoder.prototype.decodeURI = function(str) {
    return decodeURI(str);
};

Encoder.prototype.encodeURIComponent = function(str) {
    return encodeURIComponent(str);
};

Encoder.prototype.decodeURIComponent = function(str) {
    return decodeURIComponent(str);
};

Encoder.prototype.encodeXML = function(str) {
    //TODO
};

Encoder.prototype.decodeXML = function(str) {
    //TODO
};

Encoder.prototype.encodeJSON = function(str) {
    //TODO
};

Encoder.prototype.decodeJSON = function(str) {
    //TODO
};

module.exports = new Encoder();
@@ -1055,22 +1055,24 @@
 ype.
-d
 e
+n
 code
-HTMLAttr
+JavaScript
  = f
@@ -1094,310 +1094,17 @@
     
-var decoded = '';%0A%0A    if (str === undefined %7C%7C str.length === 0) %7B%0A        return decoded;%0A    %7D%0A%0A    decoded = str.replace(/&amp;/g, '&');%0A    decoded = decoded.replace(/&lt;/g, '%3C');%0A    decoded = decoded.replace(/&#39;/g, '%5C'');%0A    decoded = decoded.replace(/&quot;/g, '%22');%0A%0A    return decoded;%0A%7D
+//TODO%0A%7D;
 %0A%0AEn
@@ -1111,34 +1111,34 @@
 coder.prototype.
+d
 e
-n
 codeJavaScript =
@@ -1158,33 +1158,32 @@
 ) %7B%0A    //TODO%0A%7D
-;
 %0A%0AEncoder.protot
@@ -1758,16 +1758,389 @@
 ODO%0A%7D;%0A%0A
+Encoder.prototype.percentageEncode = function(str) %7B%0A    //TODO;%0A%7D;%0A%0AEncoder.prototype.percentageDecode = function(str) %7B%0A    //TODO%0A%7D;%0A%0AEncoder.prototype.quotedEncode = function(str) %7B%0A    //TODO%0A%7D;%0A%0AEncoder.prototype.quotedDecode = function(str) %7B%0A    //TODO%0A%7D;%0A%0AEncoder.prototype.base64Encode = function(str) %7B%0A%0A%7D;%0A%0AEncoder.prototype.base64Decode = function(str) %7B%0A%0A%7D;%0A%0A
 module.e

add more to be place holders for encoding methods