我有一个像name.label=名
我的java代码就像
Properties properties = new Properties();
try (FileInputStream inputStream = new FileInputStream(path)) {
Reader reader = new InputStreamReader(inputStream, Charset.forName("UTF-8"));
properties.load(reader);
System.out.println("Name label: " + properties.getProperty("name.label"));
reader.close();
} catch (FileNotFoundException e) {
log.debug("Couldn't find properties file. ", e);
} catch (IOException e) {
log.debug("Couldn't close input stream. ", e);
}
但它打印
姓名标签: ?
我正在使用java 8。
慕容3067478
相关分类