java - Property from properties file being read in the wrong encoding -


i have properties file properties in portuguese language, using accented characters. these properties read 3rd party library (controls fx dialogs). somehow accented characters being read in wrong encoding (tested on ms windows).

this have in properties file:

dlg.yes.button = sim dlg.no.button = não 

and how looks on running app: enter image description here

all project files (including java sources , properties files) encoding in utf-8. can test on windows, think has related windows default encoding (cp1252). tried run app using utf8 encoding option -dfile.encoding=utf8, problem still persists

any idea of why happening?

property files treated iso-8859-1 files. documentation:

the input stream in simple line-oriented format specified in load(reader) , assumed use iso 8859-1 character encoding; each byte 1 latin1 character.

you need either save file iso latin-1, or write non-ascii characters using \u escapes.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -