Descodificar datos con DecodeHTML Query

Descodificar datos de una campo de SQL codificado con encodeHTML.

public string decodeHTML(string str)
        {
            string regExp = """;

            str = str.Replace(regExp, "\"");

            regExp = "'";
            str = str.Replace(regExp, "'");

            regExp = "<";
            str = str.Replace(regExp, "<");

            regExp = "&gt;";
            str = str.Replace(regExp, ">");

            regExp = "&nbsp;";
            str = str.Replace(regExp, " ");

            regExp = "&iexcl;";
            str = str.Replace(regExp, "¡");

            regExp = "&cent;";
            str = str.Replace(regExp, "¢");

            regExp = "&pound;";
            str = str.Replace(regExp, "£");

            regExp = "&curren;";
            str = str.Replace(regExp, "¤");

            regExp = "&yen;";
            str = str.Replace(regExp, "¥");

            regExp = "&brvbar;";
            str = str.Replace(regExp, "¦");

            regExp = "&sect;";
            str = str.Replace(regExp, "§");

            regExp = "&uml;";
            str = str.Replace(regExp, "¨");

            regExp = "&copy;";
            str = str.Replace(regExp, "©");

            regExp = "&ordf;";
            str = str.Replace(regExp, "ª");

            regExp = "&laquo;";
            str = str.Replace(regExp, "«");

            regExp = "&not;";
            str = str.Replace(regExp, "¬");

            regExp = "&reg;";
            str = str.Replace(regExp, "®");

            regExp = "&macr;";
            str = str.Replace(regExp, "¯");

            regExp = "&deg;";
            str = str.Replace(regExp, "°");

            regExp = "&#177;";
            str = str.Replace(regExp, "±");

            regExp = "&sup2;";
            str = str.Replace(regExp, "²");

            regExp = "&sup3;";
            str = str.Replace(regExp, "³");

            regExp = "&acute;";
            str = str.Replace(regExp, "´");

            regExp = "&micro;";
            str = str.Replace(regExp, "µ");

            regExp = "&para;";
            str = str.Replace(regExp, "¶");

            regExp = "&middot;";
            str = str.Replace(regExp, "·");

            regExp = "&cedil;";
            str = str.Replace(regExp, "¸");

            regExp = "&sup1;";
            str = str.Replace(regExp, "¹");

            regExp = "&ordm;";
            str = str.Replace(regExp, "º");

            regExp = "&raquo;";
            str = str.Replace(regExp, "»");

            regExp = "&frac14;";
            str = str.Replace(regExp, "¼");

            regExp = "&frac12;";
            str = str.Replace(regExp, "½");

            regExp = "&frac34;";
            str = str.Replace(regExp, "¾");

            regExp = "&iquest;";
            str = str.Replace(regExp, "¿");

            regExp = "&times;";
            str = str.Replace(regExp, "×");

            regExp = "&divide;";
            str = str.Replace(regExp, "÷");

            regExp = "&Agrave;";
            str = str.Replace(regExp, "À");

            regExp = "&Aacute;";
            str = str.Replace(regExp, "Á");

            regExp = "&Acirc;";
            str = str.Replace(regExp, "Â");

            regExp = "&Atilde;";
            str = str.Replace(regExp, "Ã");

            regExp = "&Auml;";
            str = str.Replace(regExp, "Ä");

            regExp = "&Aring;";
            str = str.Replace(regExp, "Å");

            regExp = "&AElig;";
            str = str.Replace(regExp, "Æ");

            regExp = "&Ccedil;";
            str = str.Replace(regExp, "Ç");

            regExp = "&Egrave;";
            str = str.Replace(regExp, "È");

            regExp = "&Eacute;";
            str = str.Replace(regExp, "É");

            regExp = "&Ecirc;";
            str = str.Replace(regExp, "Ê");

            regExp = "&Euml;";
            str = str.Replace(regExp, "Ë");

            regExp = "&Igrave;";
            str = str.Replace(regExp, "Ì");

            regExp = "&Iacute;";
            str = str.Replace(regExp, "Í");

            regExp = "&Icirc;";
            str = str.Replace(regExp, "Î");

            regExp = "&Iuml;";
            str = str.Replace(regExp, "Ï");

            regExp = "&ETH;";
            str = str.Replace(regExp, "Ð");

            regExp = "&Ntilde;";
            str = str.Replace(regExp, "Ñ");

            regExp = "&Ograve;";
            str = str.Replace(regExp, "Ò");

            regExp = "&Oacute;";
            str = str.Replace(regExp, "Ó");

            regExp = "&Ocirc;";
            str = str.Replace(regExp, "Ô");

            regExp = "&Otilde;";
            str = str.Replace(regExp, "Õ");

            regExp = "&Ouml;";
            str = str.Replace(regExp, "Ö");

            regExp = "&Oslash;";
            str = str.Replace(regExp, "Ø");

            regExp = "&Ugrave;";
            str = str.Replace(regExp, "Ù");

            regExp = "&Uacute;";
            str = str.Replace(regExp, "Ú");

            regExp = "&Ucirc;";
            str = str.Replace(regExp, "Û");

            regExp = "&Uuml;";
            str = str.Replace(regExp, "Ü");

            regExp = "&Yacute;";
            str = str.Replace(regExp, "Ý");

            regExp = "&THORN;";
            str = str.Replace(regExp, "Þ");

            regExp = "&szlig;";
            str = str.Replace(regExp, "ß");

            regExp = "&agrave;";
            str = str.Replace(regExp, "à");

            regExp = "&aacute;";
            str = str.Replace(regExp, "á");

            regExp = "&acirc;";
            str = str.Replace(regExp, "â");

            regExp = "&atilde;";
            str = str.Replace(regExp, "ã");

            regExp = "&auml;";
            str = str.Replace(regExp, "ä");

            regExp = "&aring;";
            str = str.Replace(regExp, "å");

            regExp = "&aelig;";
            str = str.Replace(regExp, "æ");

            regExp = "&ccedil;";
            str = str.Replace(regExp, "ç");

            regExp = "&egrave;";
            str = str.Replace(regExp, "è");

            regExp = "&eacute;";
            str = str.Replace(regExp, "é");

            regExp = "&ecirc;";
            str = str.Replace(regExp, "ê");

            regExp = "&euml;";
            str = str.Replace(regExp, "ë");

            regExp = "&igrave;";
            str = str.Replace(regExp, "ì");

            regExp = "&iacute;";
            str = str.Replace(regExp, "í");

            regExp = "&icirc;";
            str = str.Replace(regExp, "î");

            regExp = "&iuml;";
            str = str.Replace(regExp, "ï");

            regExp = "&eth;";
            str = str.Replace(regExp, "ð");

            regExp = "&ntilde;";
            str = str.Replace(regExp, "ñ");

            regExp = "&ograve;";
            str = str.Replace(regExp, "ò");

            regExp = "&oacute;";
            str = str.Replace(regExp, "ó");

            regExp = "&ocirc;";
            str = str.Replace(regExp, "ô");

            regExp = "&otilde;";
            str = str.Replace(regExp, "õ");

            regExp = "&ouml;";
            str = str.Replace(regExp, "ö");

            regExp = "&oslash;";
            str = str.Replace(regExp, "ø");

            regExp = "&ugrave;";
            str = str.Replace(regExp, "ù");

            regExp = "&uacute;";
            str = str.Replace(regExp, "ú");

            regExp = "&ucirc;";
            str = str.Replace(regExp, "û");

            regExp = "&uuml;";
            str = str.Replace(regExp, "ü");

            regExp = "&yacute;";
            str = str.Replace(regExp, "ý");

            regExp = "&thorn;";
            str = str.Replace(regExp, "þ");

            regExp = "&yuml;";
            str = str.Replace(regExp, "ÿ");

            regExp = "&forall;";
            str = str.Replace(regExp, "∀");

            regExp = "&part;";
            str = str.Replace(regExp, "∂");

            regExp = "&exist;";
            str = str.Replace(regExp, "∃");

            regExp = "&empty;";
            str = str.Replace(regExp, "∅");

            regExp = "&nabla;";
            str = str.Replace(regExp, "∇");

            regExp = "&isin;";
            str = str.Replace(regExp, "∈");

            regExp = "&notin;";
            str = str.Replace(regExp, "∉");

            regExp = "&ni;";
            str = str.Replace(regExp, "∋");

            regExp = "&prod;";
            str = str.Replace(regExp, "∏");

            regExp = "&sum;";
            str = str.Replace(regExp, "∑");

            regExp = "&minus;";
            str = str.Replace(regExp, "−");

            regExp = "&lowast;";
            str = str.Replace(regExp, "∗");

            regExp = "&radic;";
            str = str.Replace(regExp, "√");

            regExp = "&prop;";
            str = str.Replace(regExp, "∝");

            regExp = "&infin;";
            str = str.Replace(regExp, "∞");

            regExp = "&ang;";
            str = str.Replace(regExp, "∠");

            regExp = "&and;";
            str = str.Replace(regExp, "∧");

            regExp = "&or;";
            str = str.Replace(regExp, "∨");

            regExp = "&cap;";
            str = str.Replace(regExp, "∩");

            regExp = "&cup;";
            str = str.Replace(regExp, "∪");

            regExp = "&int;";
            str = str.Replace(regExp, "∫");

            regExp = "&there4;";
            str = str.Replace(regExp, "∴");

            regExp = "&sim;";
            str = str.Replace(regExp, "∼");

            regExp = "&cong;";
            str = str.Replace(regExp, "≅");

            regExp = "&asymp;";
            str = str.Replace(regExp, "≈");

            regExp = "&ne;";
            str = str.Replace(regExp, "≠");

            regExp = "&equiv;";
            str = str.Replace(regExp, "≡");

            regExp = "&le;";
            str = str.Replace(regExp, "≤");

            regExp = "&ge;";
            str = str.Replace(regExp, "≥");

            regExp = "&sub;";
            str = str.Replace(regExp, "⊂");

            regExp = "&sup;";
            str = str.Replace(regExp, "⊃");

            regExp = "&nsub;";
            str = str.Replace(regExp, "⊄");

            regExp = "&sube;";
            str = str.Replace(regExp, "⊆");

            regExp = "&supe;";
            str = str.Replace(regExp, "⊇");

            regExp = "&oplus;";
            str = str.Replace(regExp, "⊕");

            regExp = "&otimes;";
            str = str.Replace(regExp, "⊗");

            regExp = "&perp;";
            str = str.Replace(regExp, "⊥");

            regExp = "&sdot;";
            str = str.Replace(regExp, "⋅");

            regExp = "&Alpha;";
            str = str.Replace(regExp, "Α");

            regExp = "&Beta;";
            str = str.Replace(regExp, "Β");

            regExp = "&Gamma;";
            str = str.Replace(regExp, "Γ");

            regExp = "&Delta;";
            str = str.Replace(regExp, "Δ");

            regExp = "&Epsilon;";
            str = str.Replace(regExp, "Ε");

            regExp = "&Zeta;";
            str = str.Replace(regExp, "Ζ");

            regExp = "&Eta;";
            str = str.Replace(regExp, "Η");

            regExp = "&Theta;";
            str = str.Replace(regExp, "Θ");

            regExp = "&Iota;";
            str = str.Replace(regExp, "Ι");

            regExp = "&Kappa;";
            str = str.Replace(regExp, "Κ");

            regExp = "&Lambda;";
            str = str.Replace(regExp, "Λ");

            regExp = "&Mu;";
            str = str.Replace(regExp, "Μ");

            regExp = "&Nu;";
            str = str.Replace(regExp, "Ν");

            regExp = "&Xi;";
            str = str.Replace(regExp, "Ξ");

            regExp = "&Omicron;";
            str = str.Replace(regExp, "Ο");

            regExp = "&Pi;";
            str = str.Replace(regExp, "Π");

            regExp = "&Rho;";
            str = str.Replace(regExp, "Ρ");

            regExp = "&Sigma;";
            str = str.Replace(regExp, "Σ");

            regExp = "&Tau;";
            str = str.Replace(regExp, "Τ");

            regExp = "&Upsilon;";
            str = str.Replace(regExp, "Υ");

            regExp = "&Phi;";
            str = str.Replace(regExp, "Φ");

            regExp = "&Chi;";
            str = str.Replace(regExp, "Χ");

            regExp = "&Psi;";
            str = str.Replace(regExp, "Ψ");

            regExp = "&Omega;";
            str = str.Replace(regExp, "Ω");

            regExp = "&alpha;";
            str = str.Replace(regExp, "α");

            regExp = "&beta;";
            str = str.Replace(regExp, "β");

            regExp = "&gamma;";
            str = str.Replace(regExp, "γ");

            regExp = "&delta;";
            str = str.Replace(regExp, "δ");

            regExp = "&epsilon;";
            str = str.Replace(regExp, "ε");

            regExp = "&zeta;";
            str = str.Replace(regExp, "ζ");

            regExp = "&eta;";
            str = str.Replace(regExp, "η");

            regExp = "&theta;";
            str = str.Replace(regExp, "θ");

            regExp = "&iota;";
            str = str.Replace(regExp, "ι");

            regExp = "&kappa;";
            str = str.Replace(regExp, "κ");

            regExp = "&lambda;";
            str = str.Replace(regExp, "λ");

            regExp = "&mu;";
            str = str.Replace(regExp, "μ");

            regExp = "&nu;";
            str = str.Replace(regExp, "ν");

            regExp = "&xi;";
            str = str.Replace(regExp, "ξ");

            regExp = "&omicron;";
            str = str.Replace(regExp, "ο");

            regExp = "&pi;";
            str = str.Replace(regExp, "π");

            regExp = "&rho;";
            str = str.Replace(regExp, "ρ");

            regExp = "&sigmaf;";
            str = str.Replace(regExp, "ς");

            regExp = "&sigma;";
            str = str.Replace(regExp, "σ");

            regExp = "&tau;";
            str = str.Replace(regExp, "τ");

            regExp = "&upsilon;";
            str = str.Replace(regExp, "υ");

            regExp = "&phi;";
            str = str.Replace(regExp, "φ");

            regExp = "&chi;";
            str = str.Replace(regExp, "χ");

            regExp = "&psi;";
            str = str.Replace(regExp, "ψ");

            regExp = "&omega;";
            str = str.Replace(regExp, "ω");

            regExp = "&thetasym;";
            str = str.Replace(regExp, "ϑ");

            regExp = "&upsih;";
            str = str.Replace(regExp, "ϒ");

            regExp = "&piv;";
            str = str.Replace(regExp, "ϖ");

            regExp = "&OElig;";
            str = str.Replace(regExp, "Œ");

            regExp = "&oelig;";
            str = str.Replace(regExp, "œ");

            regExp = "&Scaron;";
            str = str.Replace(regExp, "Š");

            regExp = "&scaron;";
            str = str.Replace(regExp, "š");

            regExp = "&Yuml;";
            str = str.Replace(regExp, "Ÿ");

            regExp = "&fnof;";
            str = str.Replace(regExp, "ƒ");

            regExp = "&circ;";
            str = str.Replace(regExp, "ˆ");

            regExp = "&tilde;";
            str = str.Replace(regExp, "˜");

            regExp = "&ensp;";
            str = str.Replace(regExp, " ");

            regExp = "&emsp;";
            str = str.Replace(regExp, " ");

            regExp = "&thinsp;";
            str = str.Replace(regExp, " ");

            regExp = "&lrm;";
            str = str.Replace(regExp, "	‎");

            regExp = "&rlm;‏‏";
            str = str.Replace(regExp, "	‏");

            regExp = "&ndash;";
            str = str.Replace(regExp, "–");

            regExp = "&mdash;";
            str = str.Replace(regExp, "—");

            regExp = "&lsquo;";
            str = str.Replace(regExp, "‘");

            regExp = "&rsquo;";
            str = str.Replace(regExp, "’");

            regExp = "&sbquo;";
            str = str.Replace(regExp, "‚");

            regExp = "&ldquo;";
            str = str.Replace(regExp, "“");

            regExp = "&rdquo;";
            str = str.Replace(regExp, "”");

            regExp = "&bdquo;";
            str = str.Replace(regExp, "„");

            regExp = "&dagger;";
            str = str.Replace(regExp, "†");

            regExp = "&Dagger;";
            str = str.Replace(regExp, "‡");

            regExp = "&bull;";
            str = str.Replace(regExp, "•");

            regExp = "&hellip;";
            str = str.Replace(regExp, "…");

            regExp = "&permil;";
            str = str.Replace(regExp, "‰");

            regExp = "&prime;";
            str = str.Replace(regExp, "′");

            regExp = "&Prime;";
            str = str.Replace(regExp, "″");

            regExp = "&lsaquo;";
            str = str.Replace(regExp, "‹");

            regExp = "&rsaquo;";
            str = str.Replace(regExp, "›");

            regExp = "&oline;";
            str = str.Replace(regExp, "‾");

            regExp = "&euro;";
            str = str.Replace(regExp, "€");

            regExp = "&trade;";
            str = str.Replace(regExp, "™");

            regExp = "&larr;";
            str = str.Replace(regExp, "←");

            regExp = "&uarr;";
            str = str.Replace(regExp, "↑");

            regExp = "&rarr;";
            str = str.Replace(regExp, "→");

            regExp = "&darr;";
            str = str.Replace(regExp, "↓");

            regExp = "&harr;";
            str = str.Replace(regExp, "↔");

            regExp = "&crarr;";
            str = str.Replace(regExp, "↵");

            regExp = "&lceil;";
            str = str.Replace(regExp, "⌈");

            regExp = "&rceil;";
            str = str.Replace(regExp, "⌉");

            regExp = "&lfloor;";
            str = str.Replace(regExp, "⌊");

            regExp = "&rfloor;";
            str = str.Replace(regExp, "⌋");

            regExp = "&loz;";
            str = str.Replace(regExp, "◊");

            regExp = "&spades;";
            str = str.Replace(regExp, "♠");

            regExp = "&clubs;";
            str = str.Replace(regExp, "♣");

            regExp = "&hearts;";
            str = str.Replace(regExp, "♥");

            regExp = "&diams;";
            str = str.Replace(regExp, "♦");

            regExp = "&#92;";
            str = str.Replace(regExp, "\\");

            return str;
        }
Descodificar datos con DecodeHTML Query
Web | + posts

Full Stack Software Developer.

Fundador de Kitaokatech y creador del ERP Hanbai.

Scroll hacia arriba