不行就用这个方法 <%! public String GB2Uni(String GB) { //this is a method for servlet loading chinese data from db. try { if (GB==null) { return ""; } GB=GB.trim(); byte[] tmp = GB.getBytes("Cp1252"); //you must change the byte code String result = new String(tmp); return result; } catch(java.io.UnsupportedEncodingException e) { System.out.println("CommonFunction.GB2Uni UnsupportedEncodingException"+e); return null; } } %>
String unitName=new String(request.getParameter("unitName").getBytes("ISO8859-1"));
<%!
public String GB2Uni(String GB) {
//this is a method for servlet loading chinese data from db.
try {
if (GB==null)
{
return "";
}
GB=GB.trim();
byte[] tmp = GB.getBytes("Cp1252"); //you must change the byte code
String result = new String(tmp);
return result;
}
catch(java.io.UnsupportedEncodingException e)
{
System.out.println("CommonFunction.GB2Uni UnsupportedEncodingException"+e);
return null;
}
}
%>