excel.properties 如下:
学号=id
Properties prop = new Properties(); InputStream inStream = Test.class.getClassLoader().getResourceAsStream("excel.properties"); prop.load(inStream); String str = new String("学号".getBytes(),"ISO8859-1"); System.out.println(new String(prop.getProperty(str).getBytes("iso8859-1"),"UTF-8"));
总结:在properties文件中保存的是iso8859-1的编码格式,要显示可以将其转化为UTF-8的编码。
properties文件中文乱码解决,布布扣,bubuko.com
原文:http://blog.csdn.net/hackcoder/article/details/22626469