打赏

properties文件中中文不能显示或者中文乱码

1、properties 文件中文乱码问题
鼠标“右击”文件 => Resource => Text file encoding => UTF-8
2、properties 文件解析中文乱码问题
Properties pps = new Properties();
pps.load(new InputStreamReader(TestProperty.class.getClassLoader().getResourceAsStream(“properties”), “UTF-8”));
3、log4j解析properties 中文乱码问题
Logger logger = Logger.getLogger(“test-log”);
Properties pps = new Properties();
pps.load(new InputStreamReader(MvneLog.class.getClassLoader().getResourceAsStream(“log4j.properties”), “UTF-8”));
PropertyConfigurator.configure(pps);

posted @ 2016-07-27 15:34  海米傻傻  阅读(8196)  评论(0编辑  收藏  举报