HTML编码、HTML解码

Java中可以使用 escapeHtml4编码,unescapeHtml4解码。

StringEscapeUtils.escapeHtml4();//HTML编码
StringEscapeUtils.unescapeHtml4();//HTML解码

完整的 HTML 4 实体参考手册

字符实体十进制十六进制描述
&&&&ampersand
<&lt;&#60;&#x3C;less than
>&gt;&#62;&#x3E;greater than
&nbsp;&#160;&#xA0;no-break space = non-breaking space
¡&iexcl;&#161;&#xA1;inverted exclamation mark
¢&cent;&#162;&#xA2;cent sign
£&pound;&#163;&#xA3;pound sign
¤&curren;&#164;&#xA4;currency sign
¥&yen;&#165;&#xA5;yen sign = yuan sign
¦&brvbar;&#166;&#xA6;broken bar = broken vertical bar
§&sect;&#167;&#xA7;section sign
¨&uml;&#168;&#xA8;diaeresis = spacing diaeresis
©&copy;&#169;&#xA9;copyright sign
ª&ordf;&#170;&#xAA;feminine ordinal indicator
«&laquo;&#171;&#xAB;left-pointing double angle quotation mark = left pointing guillemet
¬&not;&#172;&#xAC;not sign
­&shy;&#173;&#xAD;soft hyphen = discretionary hyphen
®&reg;&#174;&#xAE;registered sign = registered trade mark sign
¯&macr;&#175;&#xAF;macron = spacing macron = overline = APL overbar
°&deg;&#176;&#xB0;degree sign
±&plusmn;&#177;&#xB1;plus-minus sign = plus-or-minus sign
²&sup2;&#178;&#xB2;superscript two = superscript digit two = squared
³&sup3;&#179;&#xB3;superscript three = superscript digit three = cubed
´&acute;&#180;&#xB4;acute accent = spacing acute
µ&micro;&#181;&#xB5;micro sign
&para;&#182;&#xB6;pilcrow sign = paragraph sign
·&middot;&#183;&#xB7;middle dot = Georgian comma = Greek middle dot
¸&cedil;&#184;&#xB8;cedilla = spacing cedilla
¹&sup1;&#185;&#xB9;superscript one = superscript digit one
º&ordm;&#186;&#xBA;masculine ordinal indicator
»&raquo;&#187;&#xBB;right-pointing double angle quotation mark = right pointing guillemet
¼&frac14;&#188;&#xBC;vulgar fraction one quarter = fraction one quarter
½&frac12;&#189;&#xBD;vulgar fraction one half = fraction one half
¾&frac34;&#190;&#xBE;vulgar fraction three quarters = fraction three quarters
¿&iquest;&#191;&#xBF;inverted question mark = turned question mark
À&Agrave;&#192;&#xC0;latin capital letter A with grave = latin capital letter A grave
Á&Aacute;&#193;&#xC1;latin capital letter A with acute
Â&Acirc;&#194;&#xC2;latin capital letter A with circumflex
Ã&Atilde;&#195;&#xC3;latin capital letter A with tilde
Ä&Auml;&#196;&#xC4;latin capital letter A with diaeresis
Å&Aring;&#197;&#xC5;latin capital letter A with ring above = latin capital letter A ring
Æ&AElig;&#198;&#xC6;latin capital letter AE = latin capital ligature AE
Ç&Ccedil;&#199;&#xC7;latin capital letter C with cedilla
È&Egrave;&#200;&#xC8;latin capital letter E with grave
É&Eacute;&#201;&#xC9;latin capital letter E with acute
Ê&Ecirc;&#202;&#xCA;latin capital letter E with circumflex
Ë&Euml;&#203;&#xCB;latin capital letter E with diaeresis
Ì&Igrave;&#204;&#xCC;latin capital letter I with grave
Í&Iacute;&#205;&#xCD;latin capital letter I with acute
Î&Icirc;&#206;&#xCE;latin capital letter I with circumflex
Ï&Iuml;&#207;&#xCF;latin capital letter I with diaeresis
Ð&ETH;&#208;&#xD0;latin capital letter ETH
Ñ&Ntilde;&#209;&#xD1;latin capital letter N with tilde
Ò&Ograve;&#210;&#xD2;latin capital letter O with grave
Ó&Oacute;&#211;&#xD3;latin capital letter O with acute
Ô&Ocirc;&#212;&#xD4;latin capital letter O with circumflex
Õ&Otilde;&#213;&#xD5;latin capital letter O with tilde
Ö&Ouml;&#214;&#xD6;latin capital letter O with diaeresis
×&times;&#215;&#xD7;multiplication sign
Ø&Oslash;&#216;&#xD8;latin capital letter O with stroke = latin capital letter O slash
Ù&Ugrave;&#217;&#xD9;latin capital letter U with grave
Ú&Uacute;&#218;&#xDA;latin capital letter U with acute
Û&Ucirc;&#219;&#xDB;latin capital letter U with circumflex
Ü&Uuml;&#220;&#xDC;latin capital letter U with diaeresis
Ý&Yacute;&#221;&#xDD;latin capital letter Y with acute
Þ&THORN;&#222;&#xDE;latin capital letter THORN
ß&szlig;&#223;&#xDF;latin small letter sharp s = ess-zed
à&agrave;&#224;&#xE0;latin small letter a with grave = latin small letter a grave
á&aacute;&#225;&#xE1;latin small letter a with acute
â&acirc;&#226;&#xE2;latin small letter a with circumflex
ã&atilde;&#227;&#xE3;latin small letter a with tilde
ä&auml;&#228;&#xE4;latin small letter a with diaeresis
å&aring;&#229;&#xE5;latin small letter a with ring above = latin small letter a ring
æ&aelig;&#230;&#xE6;latin small letter ae = latin small ligature ae
ç&ccedil;&#231;&#xE7;latin small letter c with cedilla
è&egrave;&#232;&#xE8;latin small letter e with grave
é&eacute;&#233;&#xE9;latin small letter e with acute
ê&ecirc;&#234;&#xEA;latin small letter e with circumflex
ë&euml;&#235;&#xEB;latin small letter e with diaeresis
ì&igrave;&#236;&#xEC;latin small letter i with grave
í&iacute;&#237;&#xED;latin small letter i with acute
î&icirc;&#238;&#xEE;latin small letter i with circumflex
ï&iuml;&#239;&#xEF;latin small letter i with diaeresis
ð&eth;&#240;&#xF0;latin small letter eth
ñ&ntilde;&#241;&#xF1;latin small letter n with tilde
ò&ograve;&#242;&#xF2;latin small letter o with grave
ó&oacute;&#243;&#xF3;latin small letter o with acute
ô&ocirc;&#244;&#xF4;latin small letter o with circumflex
õ&otilde;&#245;&#xF5;latin small letter o with tilde
ö&ouml;&#246;&#xF6;latin small letter o with diaeresis
÷&divide;&#247;&#xF7;division sign
ø&oslash;&#248;&#xF8;latin small letter o with stroke = latin small letter o slash
ù&ugrave;&#249;&#xF9;latin small letter u with grave
ú&uacute;&#250;&#xFA;latin small letter u with acute
û&ucirc;&#251;&#xFB;latin small letter u with circumflex
ü&uuml;&#252;&#xFC;latin small letter u with diaeresis
ý&yacute;&#253;&#xFD;latin small letter y with acute
þ&thorn;&#254;&#xFE;latin small letter thorn
ÿ&yuml;&#255;&#xFF;latin small letter y with diaeresis
ƒ&fnof;&#402;&#x192;latin small f with hook = function = florin
Α&Alpha;&#913;&#x391;greek capital letter alpha
Β&Beta;&#914;&#x392;greek capital letter beta
Γ&Gamma;&#915;&#x393;greek capital letter gamma
Δ&Delta;&#916;&#x394;greek capital letter delta
Ε&Epsilon;&#917;&#x395;greek capital letter epsilon
Ζ&Zeta;&#918;&#x396;greek capital letter zeta
Η&Eta;&#919;&#x397;greek capital letter eta
Θ&Theta;&#920;&#x398;greek capital letter theta
Ι&Iota;&#921;&#x399;greek capital letter iota
Κ&Kappa;&#922;&#x39A;greek capital letter kappa
Λ&Lambda;&#923;&#x39B;greek capital letter lambda
Μ&Mu;&#924;&#x39C;greek capital letter mu
Ν&Nu;&#925;&#x39D;greek capital letter nu
Ξ&Xi;&#926;&#x39E;greek capital letter xi
Ο&Omicron;&#927;&#x39F;greek capital letter omicron
Π&Pi;&#928;&#x3A0;greek capital letter pi
Ρ&Rho;&#929;&#x3A1;greek capital letter rho
(not used)
Σ&Sigma;&#931;&#x3A3;greek capital letter sigma
Τ&Tau;&#932;&#x3A4;greek capital letter tau
Υ&Upsilon;&#933;&#x3A5;greek capital letter upsilon
Φ&Phi;&#934;&#x3A6;greek capital letter phi
Χ&Chi;&#935;&#x3A7;greek capital letter chi
Ψ&Psi;&#936;&#x3A8;greek capital letter psi
Ω&Omega;&#937;&#x3A9;greek capital letter omega
(not used)
α&alpha;&#945;&#x3B1;greek smal letter alpha
β&beta;&#946;&#x3B2;greek smal letter beta
γ&gamma;&#947;&#x3B3;greek smal letter gamma
δ&delta;&#948;&#x3B4;greek smal letter delta
ε&epsilon;&#949;&#x3B5;greek smal letter epsilon
ζ&zeta;&#950;&#x3B6;greek smal letter zeta
η&eta;&#951;&#x3B7;greek smal letter eta
θ&theta;&#952;&#x3B8;greek smal letter theta
ι&iota;&#953;&#x3B9;greek smal letter iota
κ&kappa;&#954;&#x3BA;greek smal letter kappa
λ&lambda;&#955;&#x3BB;greek smal letter lambda
μ&mu;&#956;&#x3BC;greek smal letter mu
ν&nu;&#957;&#x3BD;greek smal letter nu
ξ&xi;&#958;&#x3BE;greek smal letter xi
ο&omicron;&#959;&#x3BF;greek smal letter omicron
π&pi;&#960;&#x3C0;greek smal letter pi
ρ&rho;&#961;&#x3C1;greek smal letter rho
ς&sigmaf;&#962;&#x3C2;greek smal letter final sigma
σ&sigma;&#963;&#x3C3;greek smal letter sigma
τ&tau;&#964;&#x3C4;greek smal letter tau
υ&upsilon;&#965;&#x3C5;greek smal letter upsilon
φ&phi;&#966;&#x3C6;greek smal letter phi
χ&chi;&#967;&#x3C7;greek smal letter chi
ψ&psi;&#968;&#x3C8;greek smal letter psi
ω&omega;&#969;&#x3C9;greek smal letter omega
(not used)
ϑ&thetasym;&#977;&#x3D1;greek smal letter theta symbol
ϒ&upsih;&#978;&#x3D2;Greek upsilon with hook symbol
(not used)
ϖ&piv;&#982;&#x3D6;Greek pi symbol

特殊符号

字符实体十进制十六进制描述
&bull;&#8226;&#x2022;bullet = black small circle
&hellip;&#8230;&#x2026;horizontal ellipsis = three dot leader
&prime;&#8242;&#x2032;prime = minutes = feet
&Prime;&#8243;&#x2033;double prime = seconds = inches
&oline;&#8254;&#x203E;overline = spacing overscore
&frasl;&#8260;&#x2044;fraction slash
&weierp;&#8472;&#x2118;script capital P = power set = Weierstrass p
&image;&#8465;&#x2111;blackletter capital I = imaginary part
&real;&#8476;&#x211C;blackletter capital R = real part symbol
&trade;&#8482;&#x2122;trade mark sign
&alefsym;&#8501;&#x2135;alef symbol = first transfinite cardinal
&larr;&#8592;&#x2190;leftwards arrow
&uarr;&#8593;&#x2191;upwards arrow
&rarr;&#8594;&#x2192;rightwards arrow
&darr;&#8595;&#x2193;downwards arrow
&harr;&#8596;&#x2194;left right arrow
&crarr;&#8629;&#x21B5;downwards arrow with corner leftwards = carriage return
&lArr;&#8656;&#x21D0;leftwards double arrow
&uArr;&#8657;&#x21D1;upwards double arrow
&rArr;&#8658;&#x21D2;rightwards double arrow
&dArr;&#8659;&#x21D3;downwards double arrow
&hArr;&#8660;&#x21D4;left right double arrow
&forall;&#8704;&#x2200;for all
&part;&#8706;&#x2202;partial differential
&exist;&#8707;&#x2203;there exists
&empty;&#8709;&#x2205;empty set = null set = diameter
&nabla;&#8711;&#x2207;nabla = backward difference
&isin;&#8712;&#x2208;element of
&notin;&#8713;&#x2209;not an element of
&ni;&#8715;&#x220B;contains as member
&prod;&#8719;&#x220F;n-ary product = product sign
&sum;&#8721;&#x2211;n-ary sumation
&minus;&#8722;&#x2212;minus sign
&lowast;&#8727;&#x2217;asterisk operator
&radic;&#8730;&#x221A;square root = radical sign
&prop;&#8733;&#x221D;proportional to
&infin;&#8734;&#x221E;infinity
&ang;&#8736;&#x2220;angle
&and;&#8743;&#x2227;logical and = wedge
&or;&#8744;&#x2228;logical or = vee
&cap;&#8745;&#x2229;intersection = cap
&cup;&#8746;&#x222A;union = cup
&int;&#8747;&#x222B;integral
&there4;&#8756;&#x2234;therefore
&sim;&#8764;&#x223C;tilde operator = varies with = similar to
&cong;&#8773;&#x2245;approximately equal to
&asymp;&#8776;&#x2248;almost equal to = asymptotic to
&ne;&#8800;&#x2260;not equal to
&equiv;&#8801;&#x2261;identical to
&le;&#8804;&#x2264;less-than or equal to
&ge;&#8805;&#x2265;greater-than or equal to
&sub;&#8834;&#x2282;subset of
&sup;&#8835;&#x2283;superset of
&nsub;&#8836;&#x2284;not a subset of
&sube;&#8838;&#x2286;subset of or equal to
&supe;&#8839;&#x2287;superset of or equal to
&oplus;&#8853;&#x2295;circled plus = direct sum
&otimes;&#8855;&#x2297;circled times = vector product
&perp;&#8869;&#x22A5;up tack = orthogonal to = perpendicular
&sdot;&#8901;&#x22C5;dot operator
&lceil;&#8968;&#x2308;left ceiling = APL upstile
&rceil;&#8969;&#x2309;right ceiling
&lfloor;&#8970;&#x230A;left floor = APL downstile
&rfloor;&#8971;&#x230B;right floor
&lang;&#9001;&#x2329;left-pointing angle bracket = bra
&rang;&#9002;&#x232A;right-pointing angle bracket = ket
&loz;&#9674;&#x25CA;lozenge
&spades;&#9824;&#x2660;black spade suit
&clubs;&#9827;&#x2663;black club suit = shamrock
&hearts;&#9829;&#x2665;black heart suit = valentine
&diams;&#9830;&#x2666;black diamond suit

参考:

https://www.w3school.com.cn/charsets/ref_html_entities_4.asp

HTML 字符集

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值