public static Properties loadProperties(File file) {
		try {
			if (file.exists()) {
				byte[] propByte = FileUtils.readFileToByteArray(file);
				String propString = PropertyUtils.getAutoDecodedString(propByte, "UTF-8");
				Properties prop = new Properties();
				prop.load(new StringReader(propString));
				return prop;
			} else {
				// default empty properties.
				return new Properties();
			}
		} catch (IOException e) {
			throw processException("Fail to load property file " + file.getAbsolutePath(), e);
		}
	}
Detect encoding of given data.

@param data            byte array
@param defaultEncoding the default encoding if no encoding is sure.
@return encoding name detected encoding name
ngrinder-controller/src/main/java/org/ngrinder/common/util/PropertyUtils.java