从verycd网站上下载网页时,怎么转码也是乱码!着急!
我用eclipse写了个程序,下面是代码:
try{
url=new URL("http://lib.verycd.com/2006/10/25/0000125301.html");
BufferedInputStream bis=new BufferedInputStream(url.openStream());
StringBuffer sb=new StringBuffer();
int i=0;
while((i=bis.read())!=-1)
{
sb.append((char)i);
}
bis.close();
return sb.toString();
}
catch(Exception e)
{
return e.getMessage();
}
最后运行的结果显示乱码,我看到他网站上是用utf-8编码的,但我无论怎么转,也无法显示出正常的中文,求各位大侠帮帮忙啊!