1.设置好这几个地方
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page language="java" import="java.util.*,com.util.IPUtil" pageEncoding="gb2312"%>
JSP页面的头部
设置好META标签的编码风格
然后在保存的时候选择ANSI编码!
OK成功解决!
//-------------------------浏览器编码-----------------
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<%@ page pageEncoding="GB2312"%> //JSP页面编码:
<%@ page contentType="text/html";charset=gb2312"%> //JSP页面输出编码:
<% request.setCharacterEncoding("gb2312"); %> //JSP页面输入编码:
//------------------------MySql编码-------------------
Connection connect = java.sql.DriverManager.getConnection(
"jdbc:mysql://localhost/mydb?user=登陆帐号&password=你的密码&useUnicode=true&characterEncoding=gb2312");
阅读(867) | 评论(1) | 转发(0) |