java 读取中文配置文件问题
生活随笔
收集整理的這篇文章主要介紹了
java 读取中文配置文件问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Properties properties = new Properties();public void loadProperties(){logDebug.debugMethod("函數:loadProperties"); try {InputStream inputstream = this.getClass().getClassLoader().getResourceAsStream("CIInstanceSheetName.properties"); properties.load(inputstream);String str = "網絡層-3層交換機";str = new String(str.getBytes("utf-8"), "ISO8859-1");logDebug.debugParam("value:",properties.getProperty(str));} catch (FileNotFoundException e) { logInfo.debugParam("fileNotFound",e);e.printStackTrace();} catch (IOException e) {logInfo.debugParam("讀取配置文件出錯",e); e.printStackTrace();}}
轉載于:https://blog.51cto.com/kisuntech/1319884
總結
以上是生活随笔為你收集整理的java 读取中文配置文件问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [RDLC]报表根据字段列动态加载图片(
- 下一篇: 理解JQuery中的data()使用方法