首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

中文乱码处置

2012-10-11 
中文乱码处理有好几个地方:1.JSP设置 contentType2.Filter:utf8 Connector useBodyEncodingForURItrue

中文乱码处理

有好几个地方:

1.JSP设置 contentType

2.Filter:utf8 <Connector useBodyEncodingForURI="true" />?

?也可URIEncoding="UTF-8"

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

URIEncoding

This specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, ISO-8859-1 will be used.

?

可以用此参数,指定在使用%XX解码URL之后,用来解码URI的字符集。如果未指定,ISO-8859-1被使用。

useBodyEncodingForURI

This specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding.This setting is present for compatibility with Tomcat 4.1.x, where the encoding specified in the contentType, or explicitly set using Request.setCharacterEncoding method was also used for the parameters from the URL. The default value is false.

?

此参数指定: 是否在URI查询参数(相当于GET请求参数吧) 中使用JSP页面的contentType编码,而不是使用上面URIEncoding定死的那个编码。这个设置兼容Tomcat4.1.x,就是说,在contentType中指定的编码字符集,或用request.setCharacterEncoding方法指定的编码字符集,同样也用于URL传来的参数。默认是=false的。

暂时先就这么标注下,下班了,有时间好好整理下

热点排行