2011-12-13 57 views
0

隨着最新的更新,下面的代碼打破了。它不會將代碼添加到lb_l_ret.lbcode中。但是,這個代碼是html實體轉義的。我怎樣才能使它工作?或者我怎樣才能解碼這些html實體在JavaScript?一個很好的正則表達式來解碼htmlentities也很好!JS Html實體解碼(jQuery 1.7.1)

if (lb_l_ret.show_once>0){ 
    createCookie("arevico_lb", "1", lb_l_ret.show_once); 
} 
var decoded = $j("<div/>").html(lb_l_ret.lbcode).text(); 
$j('body').append(decoded); 

LB ret包含選項數據,不幸被編碼爲htmlentities。例如:

/* <![CDATA[ */ 
var lb_l_ret = { 
    lbcode: "&lt;a id=&quot;inline&quot; href=&quot;#data&quot; style=&quot;display: none;&quot;&gt;Show&lt;/a&gt;&lt;div style=&quot;display:none&quot;&gt;&lt;div id=&quot;data&quot; style=&quot;background-color:white;overflow:hidden;&quot;&gt;&lt;iframe src=&quot;//www.facebook.com/plugins/likebox.php?id=287663154583826&amp;width=400&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=false&amp;header=false&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;border:none; overflow:hidden; width:400px; height:258px;&quot; allowTransparency=&quot;true&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt;", 
    delay: "3000", 
    show_once: "20" 
}; 
/* ]]> */ 
+0

什麼是`lb_l_ret`? – Blender 2011-12-13 23:32:44

+0

我不知道你是如何精確調用它的,但我添加了一個lb_l_ret的例子。它基本上包含在JavaScript中的選項。 – 2011-12-13 23:41:52

回答

1

沒有JQuery,也沒有需要的DOM。可以慢。:

/** 
    * By Caio Santos 
    * [email protected] 
    * Tabela utilizada: 
    * http://www.w3schools.com/charsets/ref_html_entities_4.asp 
    * Acesse game4game.com.br 
    */ 
    function html_entity_decode(str){ 

     var replaceAll = function(str, find, replace) { 
      return str.replace(new RegExp(find, 'g'), replace); 
     } 

     str = replaceAll(str,"&amp;","&"); 
     str = replaceAll(str,"&lt;","<"); 
     str = replaceAll(str,"&gt;",">"); 
     str = replaceAll(str,"&nbsp;"," "); 
     str = replaceAll(str,"&iexcl;","¡"); 
     str = replaceAll(str,"&cent;","¢"); 
     str = replaceAll(str,"&pound;","£"); 
     str = replaceAll(str,"&curren;","¤"); 
     str = replaceAll(str,"&yen;","¥"); 
     str = replaceAll(str,"&brvbar;","¦"); 
     str = replaceAll(str,"&sect;","§"); 
     str = replaceAll(str,"&uml;","¨"); 
     str = replaceAll(str,"&copy;","©"); 
     str = replaceAll(str,"&ordf;","ª"); 
     str = replaceAll(str,"&laquo;","«"); 
     str = replaceAll(str,"&not;","¬"); 
     str = replaceAll(str,"&shy;",""); 
     str = replaceAll(str,"&reg;","®"); 
     str = replaceAll(str,"&macr;","¯"); 
     str = replaceAll(str,"&deg;","°"); 
     str = replaceAll(str,"&plusmn;","±"); 
     str = replaceAll(str,"&sup2;","²"); 
     str = replaceAll(str,"&sup3;","³"); 
     str = replaceAll(str,"&acute;","´"); 
     str = replaceAll(str,"&micro;","µ"); 
     str = replaceAll(str,"&para;","¶"); 
     str = replaceAll(str,"&middot;","·"); 
     str = replaceAll(str,"&cedil;","¸"); 
     str = replaceAll(str,"&sup1;","¹"); 
     str = replaceAll(str,"&ordm;","º"); 
     str = replaceAll(str,"&raquo;","»"); 
     str = replaceAll(str,"&frac14;","¼"); 
     str = replaceAll(str,"&frac12;","½"); 
     str = replaceAll(str,"&frac34;","¾"); 
     str = replaceAll(str,"&iquest;","¿"); 
     str = replaceAll(str,"&Agrave;","À"); 
     str = replaceAll(str,"&Aacute;","Á"); 
     str = replaceAll(str,"&Acirc;","Â"); 
     str = replaceAll(str,"&Atilde;","Ã"); 
     str = replaceAll(str,"&Auml;","Ä"); 
     str = replaceAll(str,"&Aring;","Å"); 
     str = replaceAll(str,"&AElig;","Æ"); 
     str = replaceAll(str,"&Ccedil;","Ç"); 
     str = replaceAll(str,"&Egrave;","È"); 
     str = replaceAll(str,"&Eacute;","É"); 
     str = replaceAll(str,"&Ecirc;","Ê"); 
     str = replaceAll(str,"&Euml;","Ë"); 
     str = replaceAll(str,"&Igrave;","Ì"); 
     str = replaceAll(str,"&Iacute;","Í"); 
     str = replaceAll(str,"&Icirc;","Î"); 
     str = replaceAll(str,"&Iuml;","Ï"); 
     str = replaceAll(str,"&ETH;","Ð"); 
     str = replaceAll(str,"&Ntilde;","Ñ"); 
     str = replaceAll(str,"&Ograve;","Ò"); 
     str = replaceAll(str,"&Oacute;","Ó"); 
     str = replaceAll(str,"&Ocirc;","Ô"); 
     str = replaceAll(str,"&Otilde;","Õ"); 
     str = replaceAll(str,"&Ouml;","Ö"); 
     str = replaceAll(str,"&times;","×"); 
     str = replaceAll(str,"&Oslash;","Ø"); 
     str = replaceAll(str,"&Ugrave;","Ù"); 
     str = replaceAll(str,"&Uacute;","Ú"); 
     str = replaceAll(str,"&Ucirc;","Û"); 
     str = replaceAll(str,"&Uuml;","Ü"); 
     str = replaceAll(str,"&Yacute;","Ý"); 
     str = replaceAll(str,"&THORN;","Þ"); 
     str = replaceAll(str,"&szlig;","ß"); 
     str = replaceAll(str,"&agrave;","à"); 
     str = replaceAll(str,"&aacute;","á"); 
     str = replaceAll(str,"&acirc;","â"); 
     str = replaceAll(str,"&atilde;","ã"); 
     str = replaceAll(str,"&auml;","ä"); 
     str = replaceAll(str,"&aring;","å"); 
     str = replaceAll(str,"&aelig;","æ"); 
     str = replaceAll(str,"&ccedil;","ç"); 
     str = replaceAll(str,"&egrave;","è"); 
     str = replaceAll(str,"&eacute;","é"); 
     str = replaceAll(str,"&ecirc;","ê"); 
     str = replaceAll(str,"&euml;","ë"); 
     str = replaceAll(str,"&igrave;","ì"); 
     str = replaceAll(str,"&iacute;","í"); 
     str = replaceAll(str,"&icirc;","î"); 
     str = replaceAll(str,"&iuml;","ï"); 
     str = replaceAll(str,"&eth;","ð"); 
     str = replaceAll(str,"&ntilde;","ñ"); 
     str = replaceAll(str,"&ograve;","ò"); 
     str = replaceAll(str,"&oacute;","ó"); 
     str = replaceAll(str,"&ocirc;","ô"); 
     str = replaceAll(str,"&otilde;","õ"); 
     str = replaceAll(str,"&ouml;","ö"); 
     str = replaceAll(str,"&divide;","÷"); 
     str = replaceAll(str,"&oslash;","ø"); 
     str = replaceAll(str,"&ugrave;","ù"); 
     str = replaceAll(str,"&uacute;","ú"); 
     str = replaceAll(str,"&ucirc;","û"); 
     str = replaceAll(str,"&uuml;","ü"); 
     str = replaceAll(str,"&yacute;","ý"); 
     str = replaceAll(str,"&thorn;","þ"); 
     str = replaceAll(str,"&yuml;","ÿ"); 
     str = replaceAll(str,"&fnof;","ƒ"); 
     str = replaceAll(str,"&Alpha;","?"); 
     str = replaceAll(str,"&Beta;","?"); 
     str = replaceAll(str,"&Gamma;","G"); 
     str = replaceAll(str,"&Delta;","?"); 
     str = replaceAll(str,"&Epsilon;","?"); 
     str = replaceAll(str,"&Zeta;","?"); 
     str = replaceAll(str,"&Eta;","?"); 
     str = replaceAll(str,"&Theta;","T"); 
     str = replaceAll(str,"&Iota;","?"); 
     str = replaceAll(str,"&Kappa;","?"); 
     str = replaceAll(str,"&Lambda;","?"); 
     str = replaceAll(str,"&Mu;","?"); 
     str = replaceAll(str,"&Nu;","?"); 
     str = replaceAll(str,"&Xi;","?"); 
     str = replaceAll(str,"&Omicron;","?"); 
     str = replaceAll(str,"&Pi;","?"); 
     str = replaceAll(str,"&Rho;","?"); 
     str = replaceAll(str,"&Sigma;","S"); 
     str = replaceAll(str,"&Tau;","?"); 
     str = replaceAll(str,"&Upsilon;","?"); 
     str = replaceAll(str,"&Phi;","F"); 
     str = replaceAll(str,"&Chi;","?"); 
     str = replaceAll(str,"&Psi;","?"); 
     str = replaceAll(str,"&Omega;","O"); 
     str = replaceAll(str,"&alpha;","a"); 
     str = replaceAll(str,"&beta;","ß"); 
     str = replaceAll(str,"&gamma;","?"); 
     str = replaceAll(str,"&delta;","d"); 
     str = replaceAll(str,"&epsilon;","e"); 
     str = replaceAll(str,"&zeta;","?"); 
     str = replaceAll(str,"&eta;","?"); 
     str = replaceAll(str,"&theta;","?"); 
     str = replaceAll(str,"&iota;","?"); 
     str = replaceAll(str,"&kappa;","?"); 
     str = replaceAll(str,"&lambda;","?"); 
     str = replaceAll(str,"&mu;","µ"); 
     str = replaceAll(str,"&nu;","?"); 
     str = replaceAll(str,"&xi;","?"); 
     str = replaceAll(str,"&omicron;","?"); 
     str = replaceAll(str,"&pi;","p"); 
     str = replaceAll(str,"&rho;","?"); 
     str = replaceAll(str,"&sigmaf;","?"); 
     str = replaceAll(str,"&sigma;","s"); 
     str = replaceAll(str,"&tau;","t"); 
     str = replaceAll(str,"&upsilon;","?"); 
     str = replaceAll(str,"&phi;","f"); 
     str = replaceAll(str,"&chi;","?"); 
     str = replaceAll(str,"&psi;","?"); 
     str = replaceAll(str,"&omega;","?"); 
     str = replaceAll(str,"&thetasym;","?"); 
     str = replaceAll(str,"&upsih;","?"); 
     str = replaceAll(str,"&piv;","?"); 
     str = replaceAll(str,"&bull;","•"); 
     str = replaceAll(str,"&hellip;","…"); 
     str = replaceAll(str,"&prime;","'"); 
     str = replaceAll(str,"&Prime;","?"); 
     str = replaceAll(str,"&oline;","?"); 
     str = replaceAll(str,"&frasl;","/"); 
     str = replaceAll(str,"&weierp;","P"); 
     str = replaceAll(str,"&image;","I"); 
     str = replaceAll(str,"&real;","R"); 
     str = replaceAll(str,"&trade;","™"); 
     str = replaceAll(str,"&alefsym;","?"); 
     str = replaceAll(str,"&larr;","?"); 
     str = replaceAll(str,"&uarr;","?"); 
     str = replaceAll(str,"&rarr;","?"); 
     str = replaceAll(str,"&darr;","?"); 
     str = replaceAll(str,"&harr;","?"); 
     str = replaceAll(str,"&crarr;","?"); 
     str = replaceAll(str,"&lArr;","?"); 
     str = replaceAll(str,"&uArr;","?"); 
     str = replaceAll(str,"&rArr;","?"); 
     str = replaceAll(str,"&dArr;","?"); 
     str = replaceAll(str,"&hArr;","?"); 
     str = replaceAll(str,"&forall;","?"); 
     str = replaceAll(str,"&part;","?"); 
     str = replaceAll(str,"&exist;","?"); 
     str = replaceAll(str,"&empty;","Ø"); 
     str = replaceAll(str,"&nabla;","?"); 
     str = replaceAll(str,"&isin;","?"); 
     str = replaceAll(str,"&notin;","?"); 
     str = replaceAll(str,"&ni;","?"); 
     str = replaceAll(str,"&prod;","?"); 
     str = replaceAll(str,"&sum;","?"); 
     str = replaceAll(str,"&minus;","-"); 
     str = replaceAll(str,"&lowast;","*"); 
     str = replaceAll(str,"&radic;","v"); 
     str = replaceAll(str,"&prop;","?"); 
     str = replaceAll(str,"&infin;","8"); 
     str = replaceAll(str,"&ang;","?"); 
     str = replaceAll(str,"&and;","?"); 
     str = replaceAll(str,"&or;","?"); 
     str = replaceAll(str,"&cap;","n"); 
     str = replaceAll(str,"&cup;","?"); 
     str = replaceAll(str,"&int;","?"); 
     str = replaceAll(str,"&there4;","?"); 
     str = replaceAll(str,"&sim;","~"); 
     str = replaceAll(str,"&cong;","?"); 
     str = replaceAll(str,"&asymp;","˜"); 
     str = replaceAll(str,"&ne;","?"); 
     str = replaceAll(str,"&equiv;","="); 
     str = replaceAll(str,"&le;","="); 
     str = replaceAll(str,"&ge;","="); 
     str = replaceAll(str,"&sub;","?"); 
     str = replaceAll(str,"&sup;","?"); 
     str = replaceAll(str,"&nsub;","?"); 
     str = replaceAll(str,"&sube;","?"); 
     str = replaceAll(str,"&supe;","?"); 
     str = replaceAll(str,"&oplus;","?"); 
     str = replaceAll(str,"&otimes;","?"); 
     str = replaceAll(str,"&perp;","?"); 
     str = replaceAll(str,"&sdot;","·"); 
     str = replaceAll(str,"&lceil;","?"); 
     str = replaceAll(str,"&rceil;","?"); 
     str = replaceAll(str,"&lfloor;","?"); 
     str = replaceAll(str,"&rfloor;","?"); 
     str = replaceAll(str,"&lang;","<"); 
     str = replaceAll(str,"&rang;",">"); 
     str = replaceAll(str,"&loz;","?"); 
     str = replaceAll(str,"&spades;","?"); 
     str = replaceAll(str,"&clubs;","?"); 
     str = replaceAll(str,"&hearts;","?"); 
     str = replaceAll(str,"&diams;","?"); 
     str = replaceAll(str,"&#38;","&"); 
     str = replaceAll(str,"&#60;","<"); 
     str = replaceAll(str,"&#62;",">"); 
     str = replaceAll(str,"&#160;"," "); 
     str = replaceAll(str,"&#161;","¡"); 
     str = replaceAll(str,"&#162;","¢"); 
     str = replaceAll(str,"&#163;","£"); 
     str = replaceAll(str,"&#164;","¤"); 
     str = replaceAll(str,"&#165;","¥"); 
     str = replaceAll(str,"&#166;","¦"); 
     str = replaceAll(str,"&#167;","§"); 
     str = replaceAll(str,"&#168;","¨"); 
     str = replaceAll(str,"&#169;","©"); 
     str = replaceAll(str,"&#170;","ª"); 
     str = replaceAll(str,"&#171;","«"); 
     str = replaceAll(str,"&#172;","¬"); 
     str = replaceAll(str,"&#173;",""); 
     str = replaceAll(str,"&#174;","®"); 
     str = replaceAll(str,"&#175;","¯"); 
     str = replaceAll(str,"&#176;","°"); 
     str = replaceAll(str,"&#177;","±"); 
     str = replaceAll(str,"&#178;","²"); 
     str = replaceAll(str,"&#179;","³"); 
     str = replaceAll(str,"&#180;","´"); 
     str = replaceAll(str,"&#181;","µ"); 
     str = replaceAll(str,"&#182;","¶"); 
     str = replaceAll(str,"&#183;","·"); 
     str = replaceAll(str,"&#184;","¸"); 
     str = replaceAll(str,"&#185;","¹"); 
     str = replaceAll(str,"&#186;","º"); 
     str = replaceAll(str,"&#187;","»"); 
     str = replaceAll(str,"&#188;","¼"); 
     str = replaceAll(str,"&#189;","½"); 
     str = replaceAll(str,"&#190;","¾"); 
     str = replaceAll(str,"&#191;","¿"); 
     str = replaceAll(str,"&#192;","À"); 
     str = replaceAll(str,"&#193;","Á"); 
     str = replaceAll(str,"&#194;","Â"); 
     str = replaceAll(str,"&#195;","Ã"); 
     str = replaceAll(str,"&#196;","Ä"); 
     str = replaceAll(str,"&#197;","Å"); 
     str = replaceAll(str,"&#198;","Æ"); 
     str = replaceAll(str,"&#199;","Ç"); 
     str = replaceAll(str,"&#200;","È"); 
     str = replaceAll(str,"&#201;","É"); 
     str = replaceAll(str,"&#202;","Ê"); 
     str = replaceAll(str,"&#203;","Ë"); 
     str = replaceAll(str,"&#204;","Ì"); 
     str = replaceAll(str,"&#205;","Í"); 
     str = replaceAll(str,"&#206;","Î"); 
     str = replaceAll(str,"&#207;","Ï"); 
     str = replaceAll(str,"&#208;","Ð"); 
     str = replaceAll(str,"&#209;","Ñ"); 
     str = replaceAll(str,"&#210;","Ò"); 
     str = replaceAll(str,"&#211;","Ó"); 
     str = replaceAll(str,"&#212;","Ô"); 
     str = replaceAll(str,"&#213;","Õ"); 
     str = replaceAll(str,"&#214;","Ö"); 
     str = replaceAll(str,"&#215;","×"); 
     str = replaceAll(str,"&#216;","Ø"); 
     str = replaceAll(str,"&#217;","Ù"); 
     str = replaceAll(str,"&#218;","Ú"); 
     str = replaceAll(str,"&#219;","Û"); 
     str = replaceAll(str,"&#220;","Ü"); 
     str = replaceAll(str,"&#221;","Ý"); 
     str = replaceAll(str,"&#222;","Þ"); 
     str = replaceAll(str,"&#223;","ß"); 
     str = replaceAll(str,"&#224;","à"); 
     str = replaceAll(str,"&#225;","á"); 
     str = replaceAll(str,"&#226;","â"); 
     str = replaceAll(str,"&#227;","ã"); 
     str = replaceAll(str,"&#228;","ä"); 
     str = replaceAll(str,"&#229;","å"); 
     str = replaceAll(str,"&#230;","æ"); 
     str = replaceAll(str,"&#231;","ç"); 
     str = replaceAll(str,"&#232;","è"); 
     str = replaceAll(str,"&#233;","é"); 
     str = replaceAll(str,"&#234;","ê"); 
     str = replaceAll(str,"&#235;","ë"); 
     str = replaceAll(str,"&#236;","ì"); 
     str = replaceAll(str,"&#237;","í"); 
     str = replaceAll(str,"&#238;","î"); 
     str = replaceAll(str,"&#239;","ï"); 
     str = replaceAll(str,"&#240;","ð"); 
     str = replaceAll(str,"&#241;","ñ"); 
     str = replaceAll(str,"&#242;","ò"); 
     str = replaceAll(str,"&#243;","ó"); 
     str = replaceAll(str,"&#244;","ô"); 
     str = replaceAll(str,"&#245;","õ"); 
     str = replaceAll(str,"&#246;","ö"); 
     str = replaceAll(str,"&#247;","÷"); 
     str = replaceAll(str,"&#248;","ø"); 
     str = replaceAll(str,"&#249;","ù"); 
     str = replaceAll(str,"&#250;","ú"); 
     str = replaceAll(str,"&#251;","û"); 
     str = replaceAll(str,"&#252;","ü"); 
     str = replaceAll(str,"&#253;","ý"); 
     str = replaceAll(str,"&#254;","þ"); 
     str = replaceAll(str,"&#255;","ÿ"); 
     str = replaceAll(str,"&#402;","ƒ"); 
     str = replaceAll(str,"&#913;","?"); 
     str = replaceAll(str,"&#914;","?"); 
     str = replaceAll(str,"&#915;","G"); 
     str = replaceAll(str,"&#916;","?"); 
     str = replaceAll(str,"&#917;","?"); 
     str = replaceAll(str,"&#918;","?"); 
     str = replaceAll(str,"&#919;","?"); 
     str = replaceAll(str,"&#920;","T"); 
     str = replaceAll(str,"&#921;","?"); 
     str = replaceAll(str,"&#922;","?"); 
     str = replaceAll(str,"&#923;","?"); 
     str = replaceAll(str,"&#924;","?"); 
     str = replaceAll(str,"&#925;","?"); 
     str = replaceAll(str,"&#926;","?"); 
     str = replaceAll(str,"&#927;","?"); 
     str = replaceAll(str,"&#928;","?"); 
     str = replaceAll(str,"&#929;","?"); 
     str = replaceAll(str,"&#931;","S"); 
     str = replaceAll(str,"&#932;","?"); 
     str = replaceAll(str,"&#933;","?"); 
     str = replaceAll(str,"&#934;","F"); 
     str = replaceAll(str,"&#935;","?"); 
     str = replaceAll(str,"&#936;","?"); 
     str = replaceAll(str,"&#937;","O"); 
     str = replaceAll(str,"&#945;","a"); 
     str = replaceAll(str,"&#946;","ß"); 
     str = replaceAll(str,"&#947;","?"); 
     str = replaceAll(str,"&#948;","d"); 
     str = replaceAll(str,"&#949;","e"); 
     str = replaceAll(str,"&#950;","?"); 
     str = replaceAll(str,"&#951;","?"); 
     str = replaceAll(str,"&#952;","?"); 
     str = replaceAll(str,"&#953;","?"); 
     str = replaceAll(str,"&#954;","?"); 
     str = replaceAll(str,"&#955;","?"); 
     str = replaceAll(str,"&#956;","µ"); 
     str = replaceAll(str,"&#957;","?"); 
     str = replaceAll(str,"&#958;","?"); 
     str = replaceAll(str,"&#959;","?"); 
     str = replaceAll(str,"&#960;","p"); 
     str = replaceAll(str,"&#961;","?"); 
     str = replaceAll(str,"&#962;","?"); 
     str = replaceAll(str,"&#963;","s"); 
     str = replaceAll(str,"&#964;","t"); 
     str = replaceAll(str,"&#965;","?"); 
     str = replaceAll(str,"&#966;","f"); 
     str = replaceAll(str,"&#967;","?"); 
     str = replaceAll(str,"&#968;","?"); 
     str = replaceAll(str,"&#969;","?"); 
     str = replaceAll(str,"&#977;","?"); 
     str = replaceAll(str,"&#978;","?"); 
     str = replaceAll(str,"&#982;","?"); 
     str = replaceAll(str,"&#8226;","•"); 
     str = replaceAll(str,"&#8230;","…"); 
     str = replaceAll(str,"&#8242;","'"); 
     str = replaceAll(str,"&#8243;","?"); 
     str = replaceAll(str,"&#8254;","?"); 
     str = replaceAll(str,"&#8260;","/"); 
     str = replaceAll(str,"&#8472;","P"); 
     str = replaceAll(str,"&#8465;","I"); 
     str = replaceAll(str,"&#8476;","R"); 
     str = replaceAll(str,"&#8482;","™"); 
     str = replaceAll(str,"&#8501;","?"); 
     str = replaceAll(str,"&#8592;","?"); 
     str = replaceAll(str,"&#8593;","?"); 
     str = replaceAll(str,"&#8594;","?"); 
     str = replaceAll(str,"&#8595;","?"); 
     str = replaceAll(str,"&#8596;","?"); 
     str = replaceAll(str,"&#8629;","?"); 
     str = replaceAll(str,"&#8656;","?"); 
     str = replaceAll(str,"&#8657;","?"); 
     str = replaceAll(str,"&#8658;","?"); 
     str = replaceAll(str,"&#8659;","?"); 
     str = replaceAll(str,"&#8660;","?"); 
     str = replaceAll(str,"&#8704;","?"); 
     str = replaceAll(str,"&#8706;","?"); 
     str = replaceAll(str,"&#8707;","?"); 
     str = replaceAll(str,"&#8709;","Ø"); 
     str = replaceAll(str,"&#8711;","?"); 
     str = replaceAll(str,"&#8712;","?"); 
     str = replaceAll(str,"&#8713;","?"); 
     str = replaceAll(str,"&#8715;","?"); 
     str = replaceAll(str,"&#8719;","?"); 
     str = replaceAll(str,"&#8721;","?"); 
     str = replaceAll(str,"&#8722;","-"); 
     str = replaceAll(str,"&#8727;","*"); 
     str = replaceAll(str,"&#8730;","v"); 
     str = replaceAll(str,"&#8733;","?"); 
     str = replaceAll(str,"&#8734;","8"); 
     str = replaceAll(str,"&#8736;","?"); 
     str = replaceAll(str,"&#8743;","?"); 
     str = replaceAll(str,"&#8744;","?"); 
     str = replaceAll(str,"&#8745;","n"); 
     str = replaceAll(str,"&#8746;","?"); 
     str = replaceAll(str,"&#8747;","?"); 
     str = replaceAll(str,"&#8756;","?"); 
     str = replaceAll(str,"&#8764;","~"); 
     str = replaceAll(str,"&#8773;","?"); 
     str = replaceAll(str,"&#8776;","˜"); 
     str = replaceAll(str,"&#8800;","?"); 
     str = replaceAll(str,"&#8801;","="); 
     str = replaceAll(str,"&#8804;","="); 
     str = replaceAll(str,"&#8805;","="); 
     str = replaceAll(str,"&#8834;","?"); 
     str = replaceAll(str,"&#8835;","?"); 
     str = replaceAll(str,"&#8836;","?"); 
     str = replaceAll(str,"&#8838;","?"); 
     str = replaceAll(str,"&#8839;","?"); 
     str = replaceAll(str,"&#8853;","?"); 
     str = replaceAll(str,"&#8855;","?"); 
     str = replaceAll(str,"&#8869;","?"); 
     str = replaceAll(str,"&#8901;","·"); 
     str = replaceAll(str,"&#8968;","?"); 
     str = replaceAll(str,"&#8969;","?"); 
     str = replaceAll(str,"&#8970;","?"); 
     str = replaceAll(str,"&#8971;","?"); 
     str = replaceAll(str,"&#9001;","<"); 
     str = replaceAll(str,"&#9002;",">"); 
     str = replaceAll(str,"&#9674;","?"); 
     str = replaceAll(str,"&#9824;","?"); 
     str = replaceAll(str,"&#9827;","?"); 
     str = replaceAll(str,"&#9829;","?"); 
     str = replaceAll(str,"&#9830;","?"); 
     str = replaceAll(str,"&#x26;","&"); 
     str = replaceAll(str,"&#x3C;","<"); 
     str = replaceAll(str,"&#x3E;",">"); 
     str = replaceAll(str,"&#xA0;"," "); 
     str = replaceAll(str,"&#xA1;","¡"); 
     str = replaceAll(str,"&#xA2;","¢"); 
     str = replaceAll(str,"&#xA3;","£"); 
     str = replaceAll(str,"&#xA4;","¤"); 
     str = replaceAll(str,"&#xA5;","¥"); 
     str = replaceAll(str,"&#xA6;","¦"); 
     str = replaceAll(str,"&#xA7;","§"); 
     str = replaceAll(str,"&#xA8;","¨"); 
     str = replaceAll(str,"&#xA9;","©"); 
     str = replaceAll(str,"&#xAA;","ª"); 
     str = replaceAll(str,"&#xAB;","«"); 
     str = replaceAll(str,"&#xAC;","¬"); 
     str = replaceAll(str,"&#xAD;",""); 
     str = replaceAll(str,"&#xAE;","®"); 
     str = replaceAll(str,"&#xAF;","¯"); 
     str = replaceAll(str,"&#xB0;","°"); 
     str = replaceAll(str,"&#xB1;","±"); 
     str = replaceAll(str,"&#xB2;","²"); 
     str = replaceAll(str,"&#xB3;","³"); 
     str = replaceAll(str,"&#xB4;","´"); 
     str = replaceAll(str,"&#xB5;","µ"); 
     str = replaceAll(str,"&#xB6;","¶"); 
     str = replaceAll(str,"&#xB7;","·"); 
     str = replaceAll(str,"&#xB8;","¸"); 
     str = replaceAll(str,"&#xB9;","¹"); 
     str = replaceAll(str,"&#xBA;","º"); 
     str = replaceAll(str,"&#xBB;","»"); 
     str = replaceAll(str,"&#xBC;","¼"); 
     str = replaceAll(str,"&#xBD;","½"); 
     str = replaceAll(str,"&#xBE;","¾"); 
     str = replaceAll(str,"&#xBF;","¿"); 
     str = replaceAll(str,"&#xC0;","À"); 
     str = replaceAll(str,"&#xC1;","Á"); 
     str = replaceAll(str,"&#xC2;","Â"); 
     str = replaceAll(str,"&#xC3;","Ã"); 
     str = replaceAll(str,"&#xC4;","Ä"); 
     str = replaceAll(str,"&#xC5;","Å"); 
     str = replaceAll(str,"&#xC6;","Æ"); 
     str = replaceAll(str,"&#xC7;","Ç"); 
     str = replaceAll(str,"&#xC8;","È"); 
     str = replaceAll(str,"&#xC9;","É"); 
     str = replaceAll(str,"&#xCA;","Ê"); 
     str = replaceAll(str,"&#xCB;","Ë"); 
     str = replaceAll(str,"&#xCC;","Ì"); 
     str = replaceAll(str,"&#xCD;","Í"); 
     str = replaceAll(str,"&#xCE;","Î"); 
     str = replaceAll(str,"&#xCF;","Ï"); 
     str = replaceAll(str,"&#xD0;","Ð"); 
     str = replaceAll(str,"&#xD1;","Ñ"); 
     str = replaceAll(str,"&#xD2;","Ò"); 
     str = replaceAll(str,"&#xD3;","Ó"); 
     str = replaceAll(str,"&#xD4;","Ô"); 
     str = replaceAll(str,"&#xD5;","Õ"); 
     str = replaceAll(str,"&#xD6;","Ö"); 
     str = replaceAll(str,"&#xD7;","×"); 
     str = replaceAll(str,"&#xD8;","Ø"); 
     str = replaceAll(str,"&#xD9;","Ù"); 
     str = replaceAll(str,"&#xDA;","Ú"); 
     str = replaceAll(str,"&#xDB;","Û"); 
     str = replaceAll(str,"&#xDC;","Ü"); 
     str = replaceAll(str,"&#xDD;","Ý"); 
     str = replaceAll(str,"&#xDE;","Þ"); 
     str = replaceAll(str,"&#xDF;","ß"); 
     str = replaceAll(str,"&#xE0;","à"); 
     str = replaceAll(str,"&#xE1;","á"); 
     str = replaceAll(str,"&#xE2;","â"); 
     str = replaceAll(str,"&#xE3;","ã"); 
     str = replaceAll(str,"&#xE4;","ä"); 
     str = replaceAll(str,"&#xE5;","å"); 
     str = replaceAll(str,"&#xE6;","æ"); 
     str = replaceAll(str,"&#xE7;","ç"); 
     str = replaceAll(str,"&#xE8;","è"); 
     str = replaceAll(str,"&#xE9;","é"); 
     str = replaceAll(str,"&#xEA;","ê"); 
     str = replaceAll(str,"&#xEB;","ë"); 
     str = replaceAll(str,"&#xEC;","ì"); 
     str = replaceAll(str,"&#xED;","í"); 
     str = replaceAll(str,"&#xEE;","î"); 
     str = replaceAll(str,"&#xEF;","ï"); 
     str = replaceAll(str,"&#xF0;","ð"); 
     str = replaceAll(str,"&#xF1;","ñ"); 
     str = replaceAll(str,"&#xF2;","ò"); 
     str = replaceAll(str,"&#xF3;","ó"); 
     str = replaceAll(str,"&#xF4;","ô"); 
     str = replaceAll(str,"&#xF5;","õ"); 
     str = replaceAll(str,"&#xF6;","ö"); 
     str = replaceAll(str,"&#xF7;","÷"); 
     str = replaceAll(str,"&#xF8;","ø"); 
     str = replaceAll(str,"&#xF9;","ù"); 
     str = replaceAll(str,"&#xFA;","ú"); 
     str = replaceAll(str,"&#xFB;","û"); 
     str = replaceAll(str,"&#xFC;","ü"); 
     str = replaceAll(str,"&#xFD;","ý"); 
     str = replaceAll(str,"&#xFE;","þ"); 
     str = replaceAll(str,"&#xFF;","ÿ"); 
     str = replaceAll(str,"&#x192;","ƒ"); 
     str = replaceAll(str,"&#x391;","?"); 
     str = replaceAll(str,"&#x392;","?"); 
     str = replaceAll(str,"&#x393;","G"); 
     str = replaceAll(str,"&#x394;","?"); 
     str = replaceAll(str,"&#x395;","?"); 
     str = replaceAll(str,"&#x396;","?"); 
     str = replaceAll(str,"&#x397;","?"); 
     str = replaceAll(str,"&#x398;","T"); 
     str = replaceAll(str,"&#x399;","?"); 
     str = replaceAll(str,"&#x39A;","?"); 
     str = replaceAll(str,"&#x39B;","?"); 
     str = replaceAll(str,"&#x39C;","?"); 
     str = replaceAll(str,"&#x39D;","?"); 
     str = replaceAll(str,"&#x39E;","?"); 
     str = replaceAll(str,"&#x39F;","?"); 
     str = replaceAll(str,"&#x3A0;","?"); 
     str = replaceAll(str,"&#x3A1;","?"); 
     str = replaceAll(str,"&#x3A3;","S"); 
     str = replaceAll(str,"&#x3A4;","?"); 
     str = replaceAll(str,"&#x3A5;","?"); 
     str = replaceAll(str,"&#x3A6;","F"); 
     str = replaceAll(str,"&#x3A7;","?"); 
     str = replaceAll(str,"&#x3A8;","?"); 
     str = replaceAll(str,"&#x3A9;","O"); 
     str = replaceAll(str,"&#x3B1;","a"); 
     str = replaceAll(str,"&#x3B2;","ß"); 
     str = replaceAll(str,"&#x3B3;","?"); 
     str = replaceAll(str,"&#x3B4;","d"); 
     str = replaceAll(str,"&#x3B5;","e"); 
     str = replaceAll(str,"&#x3B6;","?"); 
     str = replaceAll(str,"&#x3B7;","?"); 
     str = replaceAll(str,"&#x3B8;","?"); 
     str = replaceAll(str,"&#x3B9;","?"); 
     str = replaceAll(str,"&#x3BA;","?"); 
     str = replaceAll(str,"&#x3BB;","?"); 
     str = replaceAll(str,"&#x3BC;","µ"); 
     str = replaceAll(str,"&#x3BD;","?"); 
     str = replaceAll(str,"&#x3BE;","?"); 
     str = replaceAll(str,"&#x3BF;","?"); 
     str = replaceAll(str,"&#x3C0;","p"); 
     str = replaceAll(str,"&#x3C1;","?"); 
     str = replaceAll(str,"&#x3C2;","?"); 
     str = replaceAll(str,"&#x3C3;","s"); 
     str = replaceAll(str,"&#x3C4;","t"); 
     str = replaceAll(str,"&#x3C5;","?"); 
     str = replaceAll(str,"&#x3C6;","f"); 
     str = replaceAll(str,"&#x3C7;","?"); 
     str = replaceAll(str,"&#x3C8;","?"); 
     str = replaceAll(str,"&#x3C9;","?"); 
     str = replaceAll(str,"&#x3D1;","?"); 
     str = replaceAll(str,"&#x3D2;","?"); 
     str = replaceAll(str,"&#x3D6;","?"); 
     str = replaceAll(str,"&#x2022;","•"); 
     str = replaceAll(str,"&#x2026;","…"); 
     str = replaceAll(str,"&#x2032;","'"); 
     str = replaceAll(str,"&#x2033;","?"); 
     str = replaceAll(str,"&#x203E;","?"); 
     str = replaceAll(str,"&#x2044;","/"); 
     str = replaceAll(str,"&#x2118;","P"); 
     str = replaceAll(str,"&#x2111;","I"); 
     str = replaceAll(str,"&#x211C;","R"); 
     str = replaceAll(str,"&#x2122;","™"); 
     str = replaceAll(str,"&#x2135;","?"); 
     str = replaceAll(str,"&#x2190;","?"); 
     str = replaceAll(str,"&#x2191;","?"); 
     str = replaceAll(str,"&#x2192;","?"); 
     str = replaceAll(str,"&#x2193;","?"); 
     str = replaceAll(str,"&#x2194;","?"); 
     str = replaceAll(str,"&#x21B5;","?"); 
     str = replaceAll(str,"&#x21D0;","?"); 
     str = replaceAll(str,"&#x21D1;","?"); 
     str = replaceAll(str,"&#x21D2;","?"); 
     str = replaceAll(str,"&#x21D3;","?"); 
     str = replaceAll(str,"&#x21D4;","?"); 
     str = replaceAll(str,"&#x2200;","?"); 
     str = replaceAll(str,"&#x2202;","?"); 
     str = replaceAll(str,"&#x2203;","?"); 
     str = replaceAll(str,"&#x2205;","Ø"); 
     str = replaceAll(str,"&#x2207;","?"); 
     str = replaceAll(str,"&#x2208;","?"); 
     str = replaceAll(str,"&#x2209;","?"); 
     str = replaceAll(str,"&#x220B;","?"); 
     str = replaceAll(str,"&#x220F;","?"); 
     str = replaceAll(str,"&#x2211;","?"); 
     str = replaceAll(str,"&#x2212;","-"); 
     str = replaceAll(str,"&#x2217;","*"); 
     str = replaceAll(str,"&#x221A;","v"); 
     str = replaceAll(str,"&#x221D;","?"); 
     str = replaceAll(str,"&#x221E;","8"); 
     str = replaceAll(str,"&#x2220;","?"); 
     str = replaceAll(str,"&#x2227;","?"); 
     str = replaceAll(str,"&#x2228;","?"); 
     str = replaceAll(str,"&#x2229;","n"); 
     str = replaceAll(str,"&#x222A;","?"); 
     str = replaceAll(str,"&#x222B;","?"); 
     str = replaceAll(str,"&#x2234;","?"); 
     str = replaceAll(str,"&#x223C;","~"); 
     str = replaceAll(str,"&#x2245;","?"); 
     str = replaceAll(str,"&#x2248;","˜"); 
     str = replaceAll(str,"&#x2260;","?"); 
     str = replaceAll(str,"&#x2261;","="); 
     str = replaceAll(str,"&#x2264;","="); 
     str = replaceAll(str,"&#x2265;","="); 
     str = replaceAll(str,"&#x2282;","?"); 
     str = replaceAll(str,"&#x2283;","?"); 
     str = replaceAll(str,"&#x2284;","?"); 
     str = replaceAll(str,"&#x2286;","?"); 
     str = replaceAll(str,"&#x2287;","?"); 
     str = replaceAll(str,"&#x2295;","?"); 
     str = replaceAll(str,"&#x2297;","?"); 
     str = replaceAll(str,"&#x22A5;","?"); 
     str = replaceAll(str,"&#x22C5;","·"); 
     str = replaceAll(str,"&#x2308;","?"); 
     str = replaceAll(str,"&#x2309;","?"); 
     str = replaceAll(str,"&#x230A;","?"); 
     str = replaceAll(str,"&#x230B;","?"); 
     str = replaceAll(str,"&#x2329;","<"); 
     str = replaceAll(str,"&#x232A;",">"); 
     str = replaceAll(str,"&#x25CA;","?"); 
     str = replaceAll(str,"&#x2660;","?"); 
     str = replaceAll(str,"&#x2663;","?"); 
     str = replaceAll(str,"&#x2665;","?"); 
     str = replaceAll(str,"&#x2666;","?"); 

     return str; 
    }