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);
		}

你可能感兴趣的:(properties)