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
for html to utf8 i'm doing something like thisCode: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 }
and there is more...i've just stopped here for this example...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 }
appreciate the ideas...


Reply With Quote
Bookmarks