急切求助!!httpclient中文参数的问题!在线等待.
请大侠们看看我的问题!!
用httpclient做一个获得网上信息的程式,传递英文的可以,传递中文出现乱码!
我的代码:
String url=(" /vehicle/precisesearch.do?section=130000&hpzl=02&prehp=冀A&hphm=66666");
int s=client.executeMethod(get);
提示错误:escaped query not valid
如果用这种方式编码:
String url =new String("/vehicle/precisesearch.do?section=130000&hpzl=02&prehp=冀A&hphm=66666".getBytes(),"iso-8859-1
-");
提示错误是:Error 500.
用这种方式编码:
String url = java.net.URLEncoder.encode("/vehicle/precisesearch.do?section=130000&hpzl=02&prehp=冀A&hphm=66666");
提示错误是:
The requested URL /vehicle/precisesearch.do?section=130000&hpzl=02&prehp=??A&hphm=66666 was not found on this server.
请问大家怎么办啊!