try{
String str = "test.asp?name=苹果&name2=333"
URL normalizerJTP = new URL(applet.getCodeBase(),str);//这里应该出现错误了,URL没有协议,而不是编码问题
BufferedReader in = new BufferedReader(new InputStreamReader(normalizerJTP.openStream()));
String read = null;
while ((read = in.readLine()) != null)
{
System.out.println(read.trim());
}
in.close();
}
catch (IOException e)
{
System.out.println("从服务器读数据错误");
}
还有,你要把参数提交给页面必须用outputstream把x=y&n=m格式的字节流输出到页面,而不是直接把参数写到url里面
这段代码是正确使用的代码,在PC下运行没有问题请问yakuu用getBytes如何做轮换?是什么iso8859吗?我已经试过了,转了一次,不成功,结果成了"??"