如下所示:
public static string getconfig(string key) {
properties pros = new properties();
string value = "";
try {
pros.load(new inputstreamreader(object.class.getresourceasstream("/properties.properties"), "utf-8"));
value = pros.get(key).tostring();
} catch (ioexception e) {
log.error(e.getmessage());
}
return value;
}
以上就是小编为大家带来的java读取properties配置文件时,出现中文乱码的解决方法全部内容了,希望大家多多支持~
更多java读取properties配置文件时,出现中文乱码的解决方法。