java写的程序不支持中文?你用判断中英文网页的功夫还不如去完善程序支持中文呢

解决方案 »

  1.   


    或者拿解码后的网页中的内容去和iso-8859中的码值一个个去比较
      

  2.   

    呵呵,本来想着URLConnection的getContentEncoding()可以得到,但是是null的,好像不行
    try{
    URL url=new URL("http://community.csdn.net/Expert/Forum.asp");
    System.out.println(url.openConnection().getContentType());
    System.out.println(url.openConnection().getContentEncoding());
    }catch(Exception e){

    }
      

  3.   

    查找charset=gb2312/iso-8859-1/utf-8
    不行就一个一个试