I'm trying to read properties from a constants.properties file using java.utils.Properties. Only, some of these properties contain accented characters like é, è, ô, and when I read them using getProperty(), the accents are removed. ie:
Générateur de formulaire
becomes
Generateur de formulaire
I know that Property files are read with the ISO 8859-1 encoding, so I've already tried switching out the characters for unicode escapes:
FORM_GENERATOR_VALUE=Générateur de formulaires
became
FORM_GENERATOR_VALUE=G\u0065n\u0065rateur de formulaires
However this still gives off the same result. When I halt execution and look at the variables, the strings I read from my file with getProperty() still have no accents.
Here is how my Properties are initialized:
public Properties constants = new Properties(); constants.load(new FileInputStream("constants.properties")); I've seen that one solution would be to switch the Property file format from .property to .xml but ideally I would like not to have to do that since it would imply rewriting my entire constant file again.