2

I have problems with russian encoding in my java application. It's reproduced only in case of build artifact. While running from IDE everything works correctly.

To inspect this issue I've created a trivial hello world app which just prints a phrase in russian to console.

then I've created jar artifact (didn't change any preferences) and builed this artifact. When I start my jar from console - I have an incorrect output.

Tried changing all the encodings in the "Settings" to UTF-8 - didn't help.

leshka
  • 1,764
  • 6
  • 32
  • 42
  • What do you mean by "build artifact"? How do you compile your classes? – JB Nizet Mar 15 '14 at 11:26
  • When you run your jar in console, the IDE Settings are out of its scope, nor the Settings have any impact on the built jar when building the artifact. You may want to check this old post related to your question and changes may have to be made with the code -> [How to Force a jar to uses(or the jvm runs in) utf-8 instead of the system's default encoding](http://stackoverflow.com/questions/4159551/how-to-force-a-jar-to-usesor-the-jvm-runs-in-utf-8-instead-of-the-systems-def) – Rebecca Abriam Mar 15 '14 at 11:43
  • @JBNizet By "build artifact" I mean: project -> open module settings -> artifacts -> + -> jar -> from module with dependencies -> choose my main class. Then Build -> build artifacts -> artifact name -> build. Then use jar file from the "out" folder – leshka Mar 15 '14 at 11:54
  • @RebeccaAbriam > java -Dfile.encoding=utf-8 -jar xxx.jar didn't help me... – leshka Mar 15 '14 at 11:56
  • @leshka Not sure if case matters, but did you try UTF-8 instead of utf-8? – Rebecca Abriam Mar 15 '14 at 12:09
  • "UTF-8" instead of "utf-8" didn't help – leshka Mar 17 '14 at 07:22

0 Answers0