So I started writing some functions to do this but i cannot be the first one to think of this or what to accomplish this...in javascript.

So for utf8 to html I'm doing something like this

Code:
function utf8tohtml(utftxt)
{
        utftxt = utftxt.replace(/&/g,"&")
        utftxt = utftxt.replace(//g,"Á")
        utftxt = utftxt.replace(//g,"É")
        utftxt = utftxt.replace(//g,"Í")
        utftxt = utftxt.replace(//g,"Ó")
        utftxt = utftxt.replace(//g,"Ú")
        utftxt = utftxt.replace(//g,"Ý")
        utftxt = utftxt.replace(//g,"ý")
        utftxt = utftxt.replace(//g,"á")
        utftxt = utftxt.replace(//g,"é")
        return utftxt
}
for html to utf8 i'm doing something like this

Code:
function htmltoutf(txt)
{
        txt = txt.replace(/}/,'}');      // right curly brace
        txt = txt.replace(/~/,'~');      // tilde
        txt = txt.replace(//,'');      // box
        txt = txt.replace(/€/,'');      // Euro
        txt = txt.replace(//,'');      // florin
        txt = txt.replace(//,'');      // ellipsis
        txt = txt.replace(//,'');      // circumflex accent
        txt = txt.replace(//,'');      // 
        txt = txt.replace(//,'');      // capital OE ligature
        return txt
}
and there is more...i've just stopped here for this example...

appreciate the ideas...