java 读取properties文件 UTF-8


Properties properties = new Properties();
		try {
//			ClassLoader cl = ClientConfig.class.getClassLoader();
//			InputStream is = cl.getResourceAsStream("client.properties");
			InputStream is = new FileInputStream(new File(System.getProperty("user.dir")+"/"+"client.properties"));
			properties.load(new InputStreamReader(is, "UTF-8"));    
//			properties.load(is);
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		}

猜你喜欢

转载自tianqiushi.iteye.com/blog/2162838