日期:2014-05-18  浏览次数:20592 次

html提交乱码问题,传统的方法都试完了,还是不行
整个工程都是以UTF-8构建,如果编码格式是utf-8,get,post提交都能成功。
但是html文件,设置content= "text/html;charset=gb2312 "提交就会成乱码
<html>
<head>
<META   http-equiv= "Content-Type "   content= "text/html;charset=gb2312 ">
</head>
<body>
      <form   name= "form1 "   action= "/addcomment.do "   method= "post ">
        contents: <input   type= "text "   name= "contents "/>
        <input   type= "submit "/>
      </form>
</body>
</html>
但是如果在这个html文件头上加下
<%@   page   contentType= "text/html;charset=utf-8 "   language= "java "   %>
换成jsp就不会出现乱码问题.

各位大哥帮帮小弟

------解决方案--------------------
为什么要用utf-8呢,全部都用gbk,或者在web.xml里面配置过滤器