String sss ="你";
String line = new String(sss.getBytes("ISO-8859-1"),"GBK");
or
String line = new String(sss.getBytes("gb2312"));
String line = new String(sss.getBytes("ISO-8859-1"),"GBK");
or
String line = new String(sss.getBytes("gb2312"));
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
}
return "null";
} 试一试<%@page language="java" contentType="text/html;charset=gb2312">
or
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
java.net
Class URLEncoder
java.lang.Object
|
+--java.net.URLEncoderstatic String encode(String s)
Translates a string into x-www-form-urlencoded format.