编码工具

全部统一用utf-8:

1.设置tomcat,使得tomcat在处理Get请求参数的时候用UTF-8编码。编辑tomcat的配置文件server.xml 设置<conector>URLEncoding属性为"UTF-8"。

2.web.xml:

<filter>
		<filter-name>characterEncodingFilter</filter-name>
		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>characterEncodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

3.jsp:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>

4.数据库

utf-8编码


你可能感兴趣的:(编码工具)