Hola:
A partir de las parejas de entidades(caracter/codificación) se puede usar un sencillo script:
Código:
<html>
<head>
<title>
htmlentities
</title>
<script type="text/javascript">
function parejas(char, code){
this.char = char;
this.code = code;
}
var pares = new Array();
pares[0] = new parejas("€", "€");
pares[1] = new parejas("á", "á");
function htmlentities(txt) {
for (var i = 0, total = pares.length; i < total; i ++)
txt = txt.replace(new RegExp(pares[i].char, "g"), pares[i].code)
return txt;
}
</script>
</head>
<body >
<form action="javascript: alert(htmlentities(document.forms[0].tex.value))" >
<textarea name="tex" ></textarea>
<button type="submit" >traducir</button>
</form>
</body>
</html>
Saludos