&nbsp|&quot|&amp|&lt|&gt等html字符转义

本文提供了一个全面的HTML特殊字符对照表,包括了常用的转义字符、ISO 8859-1字符集、数学符号、箭头符号等,并列举了它们在HTML中的不同表示方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文地址:http://blog.csdn.net/wusuopubupt/article/details/8817826

by wusuopubupt

提示:请直接按CTRL+F搜索您要查找的转义字符。


常用表:


No. 文字表記 10進表記 16進表記 文字   Comment
001 " " " """   quotation mark = APL quote
002 & & & "&"   ampersand
003 &lt; &#60; &#x3C; "<"   less-than sign
004 &gt; &#62; &#x3E; ">"   greater-than sign
005 &nbsp; &#160; &#xA0; " "   no-break space = non-breaking space

iSO 8859-1 characters

char glyph HTML tag
  &nbsp;
¡ &iexcl;
¢ &cent;
£ &pound;
¤ &curren;
¥ &yen;
¦ &brvbar;
§ &sect;
¨ &uml;
© &copy;
ª &ordf;
« &laquo;
¬ &not;
  &shy;
® &reg;
¯ &macr;
° &deg;
± &plusmn;
² &sup2;
³ &sup3;
´ &acute;
µ &micro;
&para;
· &middot;
¸ &cedil;
¹ &sup1;
º &ordm;
» &raquo;
¼ &frac14;
½ &frac12;
¾ &frac34;
¿ &iquest;
À &Agrave;
Á &Aacute;
 &Acirc;
à &Atilde;
Ä &Auml;
Å &Aring;
Æ &AElig;
Ç &Ccedil;
È &Egrave;
É &Eacute;
Ê &Ecirc;
Ë &Euml;
Ì &Igrave;
Í &Iacute;
Î &Icirc;
Ï &Iuml;
Ð &ETH;
Ñ &Ntilde;
Ò &Ograve;
Ó &Oacute;
Ô &Ocirc;
Õ &Otilde;
Ö &Ouml;
× &times;
Ø &Oslash;
Ù &Ugrave;
Ú &Uacute;
Û &Ucirc;
Ü &Uuml;
Ý &Yacute;
Þ &THORN;
ß &szlig;
à &agrave;
á &aacute;
â &acirc;
ã &atilde;
ä &auml;
å &aring;
æ &aelig;
ç &ccedil;
è &egrave;
é &eacute;
ê &ecirc;
ë &euml;
ì &igrave;
í &iacute;
î &icirc;
ï &iuml;
ð &eth;
ñ &ntilde;
ò &ograve;
ó &oacute;
ô &ocirc;
õ &otilde;
ö &ouml;
÷ &divide;
ø &oslash;
ù &ugrave;
ú &uacute;
û &ucirc;
ü &uuml;
ý &yacute;
þ &thorn;
ÿ &yuml;

Math symbols

Latin Extended-B
char glyph HTML tag
ƒ &fnof;

Arrows
char glyph HTML tag
&larr;
&uarr;
&rarr;
&darr;
&harr;
&crarr;
&lArr;
&uArr;
&rArr;
&dArr;
&hArr;

Mathematical Operators
char glyph HTML tag
&forall;
&part;
&exist;
&empty;
&nabla;
&isin;
&notin;
&ni;
&prod;
&sum;
&minus;
&lowast;
&radic;
&prop;
&infin;
&ang;
&and;
&or;
&cap;
&cup;
&int;
&there4;
&sim;
&cong;
&asymp;
&ne;
&equiv;
&le;
&ge;
&sub;
&sup;
&nsub;
&sube;
&supe;
&oplus;
&otimes;
&perp;
&sdot;

General Punctuation
char glyph HTML tag
&bull;
&hellip;
&prime;
&Prime;
&oline;
&frasl;

Miscellaneous Technical
char glyph HTML tag
&lceil;
&rceil;
&lfloor;
&rfloor;
&lang;
&rang;

Geometric Shapes
char glyph HTML tag
&loz;

Miscellaneous Symbols
char glyph HTML tag
&spades;
&clubs;
&hearts;
&diams;


Letterlike Symbols
char glyph HTML tag
&weierp;
&image;
&real;
&trade;
&alefsym;

Greek
char glyph HTML tag
Α &Alpha;
Β &Beta;
Γ &Gamma;
Δ &Delta;
Ε &Epsilon;
Ζ &Zeta;
Η &Eta;
Θ &Theta;
Ι &Iota;
Κ &Kappa;
Λ &Lambda;
Μ &Mu;
Ν &Nu;
Ξ &Xi;
Ο &Omicron;
Π &Pi;
Ρ &Rho;
Σ &Sigma;
Τ &Tau;
Υ &Upsilon;
Φ &Phi;
Χ &Chi;
Ψ &Psi;
Ω &Omega;
α &alpha;
β &beta;
γ &gamma;
δ &delta;
ε &epsilon;
ζ &zeta;
η &eta;
θ &theta;
ι &iota;
κ &kappa;
λ &lambda;
μ &mu;
ν &nu;
ξ &xi;
ο &omicron;
π &pi;
ρ &rho;
ς &sigmaf;
σ &sigma;
τ &tau;
υ &upsilon;
φ &phi;
χ &chi;
ψ &psi;
ω &omega;
ϑ &thetasym;
ϒ &upsih;
ϖ &piv;



&lt;think&gt;好的,我现在需要回答用户关于Tomcat 9.0 Connector配置的问题。用户提供了几个配置参数,如relaxedPathChars、relaxedQueryChars、useBodyEncodingForURI和URIEncoding,并希望确认给定的配置代码是否适用于Tomcat 9.0,同时需要示例和兼容性说明。 首先,我要回忆Tomcat 9的文档。Tomcat 9的Connector配置在server.xml中,通常使用HTTP/1.1或APR协议。用户给出的示例配置中使用了Http11AprProtocol,这需要APR库支持,而Tomcat 9确实支持这个协议,但需要正确安装APR库,否则可能无法启动。 接下来看用户提供的配置代码,里面有几个参数需要检查。比如executor=&quot;tomcatThreadPool&quot;,这在Tomcat 9中是合法的,前提是定义了该Executor。port、protocol等属性都是基础配置,没有问题。然后检查用户提到的特定参数: 1. relaxedPathChars和relaxedQueryChars:这两个参数在Tomcat 7.0.73之后引入,用于放宽URL中对路径和查询字符的校验。Tomcat 9继续支持这些参数,允许用户指定哪些字符不被转义,例如允许一些特殊字符如^、`等,这在处理非标准URL时有用。需要确认用户是否需要这些字符,否则默认设置即可。 2. useBodyEncodingForURI:这个参数在Tomcat中用于指定是否使用请求体的编码来处理URI查询参数,默认为false。当设置为true时,会覆盖URIEncoding的设置。Tomcat 9支持此参数,但需要注意如果同时设置URIEncoding和useBodyEncodingForURI=true,后者可能覆盖前者,需要根据文档说明正确配置。 3. URIEncoding:这个参数设置URI查询参数的解码字符集,默认是ISO-8859-1。用户示例中设置为UTF-8,这在Tomcat 9中是有效的,可以正确处理UTF-8编码的URL参数。但要注意,useBodyEncodingForURI设置为true时,URIEncoding可能被忽略,需参考引用[2]中的说明。 然后,用户提供的示例配置里还有compression相关设置,如compression=&quot;on&quot;和compressionMinSize=&quot;1024&quot;,这些在Tomcat 9中也是支持的,但需要注意compressibleMimeType的默认值是否符合需求。另外,acceptCount、maxThreads等参数需要结合线程池配置,确保Executor正确配置,否则可能不会生效。 还需要检查协议配置,protocol=&quot;org.apache.coyote.http11.Http11AprProtocol&quot;在Tomcat 9中有效,但必须安装APR和OpenSSL库,否则启动会报错。如果用户没有安装,应建议改用NIO或NIO2协议,如HTTP/1.1的默认NIO实现。 总结用户的问题,需要给出一个适用于Tomcat 9的Connector配置示例,包含提到的参数,并解释每个参数的兼容性和注意事项。同时指出用户提供的示例是否适用,可能需要调整的地方,如APR依赖、参数组合的影响等。 最后,根据用户提供的引用内容,特别是引用[2]和[5]中关于URIEncoding和useBodyEncodingForURI的说明,强调这些参数的正确使用方式,避免配置冲突。例如,如果同时设置了useBodyEncodingForURI=true和URIEncoding,实际可能以useBodyEncodingForURI为准,需要根据应用需求决定如何配置。&lt;/think&gt;根据Tomcat 9.0的官方文档和配置特性,以下是适用于Tomcat 9.0的Connector配置示例及关键参数解析: ### 标准Connector配置示例(Tomcat 9.0兼容) ```xml &lt;Connector executor=&quot;tomcatThreadPool&quot; port=&quot;8080&quot; protocol=&quot;org.apache.coyote.http11.Http11Nio2Protocol&quot; connectionTimeout=&quot;20000&quot; redirectPort=&quot;8443&quot; acceptCount=&quot;900&quot; maxThreads=&quot;200&quot; URIEncoding=&quot;UTF-8&quot; relaxedPathChars=&quot;[]|{}^\`&quot;&lt;&gt;&quot; relaxedQueryChars=&quot;[]|{}^\`&quot;&lt;&gt;&quot; useBodyEncodingForURI=&quot;true&quot; compression=&quot;on&quot; compressionMinSize=&quot;1024&quot; disableUploadTimeout=&quot;true&quot; enableLookups=&quot;false&quot;/&gt; ``` ### 关键参数兼容性说明 1. **relaxedPathChars / relaxedQueryChars** - 用于放宽URL路径/查询参数的字符校验规则,支持特殊字符如`^`、`{`、`}`等 - 自Tomcat 7.0.73+引入,Tomcat 9.0完全兼容[^2][^5] - 需用HTML实体编码表示特殊字符(如`&lt;`需写为`&lt;`) 2. **useBodyEncodingForURI** - 当设置为`true`时,URI查询参数解码优先使用请求头`Content-Type`中的编码,而非`URIEncoding` - 默认值为`false`,Tomcat 9.0保持对该参数的支持[^2][^5] 3. **URIEncoding** - 定义URI查询参数的默认解码字符集(默认`ISO-8859-1`) - 若`useBodyEncodingForURI=&quot;true&quot;`,此参数会被覆盖[^2] 4. **protocol=&quot;Http11AprProtocol&quot;** - 需APR库支持(需安装`tomcat-native`和OpenSSL) - 若未安装APR,建议改用`Http11Nio2Protocol`(默认协议) ### 原配置代码的兼容性分析 - **兼容部分** `URIEncoding=&quot;UTF-8&quot;`、`compression`、`acceptCount`等基础参数在Tomcat 9.0中仍有效[^1][^5] - **需验证部分** 1. `executor=&quot;tomcatThreadPool&quot;`需在`&lt;Executor&gt;`标签中明确定义线程池 2. `Http11AprProtocol`需服务器安装APR库,否则启动报错[^3] ### 推荐优化方向 1. **性能调参** - 根据实际负载调整`maxThreads`(建议500-800)和`acceptCount`(建议与`maxThreads`一致)[^5] - 启用NIO2协议以提升并发能力:`protocol=&quot;org.apache.coyote.http11.Http11Nio2Protocol&quot;` 2. **安全增强** ```xml &lt;!-- 禁止高风险符号 --&gt; relaxedQueryChars=&quot;-&quot; relaxedPathChars=&quot;-&quot; ```
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值