Light-Commons 加入 ExProperties方便Properties文件的中文配置
java中的properties文件中的中文需要用 \uxxxx来表示,非常麻烦。虽然有IDE的帮助,可以减少转码的过程。但这仍然是properties的一大缺陷。因此Light-commons加入了一个ExProperties类。可以支持iso-8859-1以外的编码格式。
#testutf8.properties
#测试 中文名=中文值
#TestExProperties.java
ExProperties exProperties = new ExProperties();
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("testutf8.properties");
exProperties.load(is, "utf-8");
assertEquals("中文值", exProperties.getProperty("中文名"));