Tuesday, January 23, 2018

Display Unicode chars in Runnable Jar from the property file

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class Translation {


static final String FILE_PATH = "C:\\muttusel\\MyAndroid\\src\\com\\hulagabal\\WeatherBot\\LanguageEnglish.property";

static Properties prop = new Properties();

static String value;


public static String setLanguage(String key) throws Exception {


prop.load(new InputStreamReader(new FileInputStream(new File(FILE_PATH)), "UTF-8"));


value = prop.getProperty(key);


return value;


}


}