cndavy

导航

 

  java 在使用getresource获取中午目录时,出现乱码的处理

String inputFileName = BufferedDataSetSample.class.getResource("data/iris_data_normalised.txt").getFile();

try {
            inputFileName=  java.net.URLDecoder.decode(inputFileName,"utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

posted on 2014-01-14 10:11  cndavy  阅读(665)  评论(0编辑  收藏  举报