JSP中文乱码解决办法汇总

来源:互联网 发布:平板支撑 知乎 编辑:程序博客网 时间:2024/05/20 02:28
  1. IDE(例如myeclipse编码),Window->Preferences->General->Workspace->Text file encoding,(UTF-8,GBK)
  2. JSP编码(pageEncoding="utf-8";<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />)
  3. servlet编码(request.setCharacterEncoding("utf-8");response.setCharacterEncoding("utf-8"))
  4. mysql编码(数据库编码、表编码、字段编码、command line client编码:set names GBK)
  5. tomcat:修改conf/server.xml文件,在Connector便签中添加3、useBodyEncodingForURI="true";2、或者添加URIEncoding="UTF-8" useURIEncoding="true"。
0 0
原创粉丝点击