function decode(string) {
    return string.replace(/%[a-fA-F0-9]{2}/ig, function (match) {
        return String.fromCharCode(parseInt(match.replace('%', ''), 16));
    });
}
function decode(string) {
    return string.replace(/%[a-fA-F0-9]{2}/ig, function (match) {
        return String.fromCharCode(parseInt(match.replace('%', ''), 16));
    });
}
function decode ( string ) { return string . replace ( / %[a-fA-F0-9]{2} / ig , function ( match ) { return String . fromCharCode ( parseInt ( match . replace ( '%' , '' ) , 16 ) ) ; } ) ; }
rfc3986 compatable decode of a string

@param {String} string
rfc3986 compatable decode of a string