29
2006
10

JSP页面中出现乱码的解决办法

以下提供的几个解决办法都是在平时的编写过程中遇到的,供大家参考: 1.< %@ page language="java" contentType="text/html;charset=gb2312"%> 2.< %request.setCharacterEncoding("gb2312");%> 3.< %!String getStr(String s) { String result=null; byte[] temp; try { temp=s.getBytes("iso-8859-1"); result=new String(temp); } catch(Exception e) { System.out.println(e.getMessage()); } return result; } %>
« 上一篇 下一篇 »