0

I'm trying to run some swing app. Language constants are in a bundle in the *.properties files in windows-1251 encoding. But when i run the app, it displays text in labels in CP1252. I've tried to compile the app with -encoding option, and run it with -Dencoding=Cp1251, but no success. What else should i do? How to make it display labels correctly?

WebComer
  • 1,131
  • 2
  • 19
  • 31
  • 1
    You could try with `-Dfile.encoding=Cp1251` but besides that I'd just define the encoding when reading the files. – Thomas Jun 14 '16 at 13:09
  • Read the second answer from here: http://stackoverflow.com/questions/863838/java-properties-utf-8-encoding-in-eclipse – huellif Jun 14 '16 at 13:10
  • Thanks for the help, the combined solution wins it! – WebComer Jun 14 '16 at 14:58
  • Unless you have supplied a ResourceBundle.Control object that overrides [newBundle](http://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.Control.html#newBundle-java.lang.String-java.util.Locale-java.lang.String-java.lang.ClassLoader-boolean-), ResourceBundle properties files are ISO-8859-1 files, regardless of the system’s default charset. Any characters in the properties files which are not ISO-8859-1 characters will need to be written as `\u` escape sequences. – VGR Jun 14 '16 at 15:01

0 Answers0