These should get you started
function decodeHtmlNumeric( str ) {
return str.replace( /&#([0-9]{1,7});/g, function( g, m1 ){
return String.fromCharCode( parseInt( m1, 10 ) );
}).replace( /&#[xX]([0-9a-fA-F]{1,6});/g, function( g, m1 ){
return String.fromCharCode( parseInt( m1, 16 ) );
});
}
function decodeOctal( str ) {
return str.replace( /\\([0-7]+)/g, function( g, m1 ) {
return String.fromCharCode( parseInt( m1, 8 ) );
});
}
//Double \\ = one backslash
decodeOctal("\\74br /\\76"); //"<br />"
decodeHtmlNumeric("ÿ"); //"ÿ"