new String(filename.getBytes(),"GBK"); 

解决方案 »

  1.   

    如果不行,换这个!
    new String(filename.getBytes(),"UTF-8"); 
      

  2.   

    filename.getBytes()中不指定编码方式,使用默认平台提供的编码方式获取
      

  3.   

    new String(filename.getBytes(),"UTF-8"); 
    new String(filename.getBytes(),"GBK"); 
    都不行啊
      

  4.   

    另外使用
    System.getProperty("file.encoding")得出的是"UTF-8"
      

  5.   

    file.encoding是UTF-8
    那filename.encoding呢?
      

  6.   

    楼上的,没有 filename.encoding 属性吧
      

  7.   

    是没有,我只是想表达个意思,文件名可能不是UTF-8的