I wrote a small Java application which output includes Unicode characters. When I use Eclipse to run it—I see all the output as expected.
The people who are supposed to use the application will run it as a jar file. I thought they could use standard cmd window, but in this window the Unicode appear as Gibberish.
Is there a way to make "cmd window" recognize the Unicode chars and display them properly? Or, is there any tool to easily run the jar file and get the correct output?
BTW - redirecting the output to a file works okay, but the program is interactive, so this will not be a good solution.
Edit: Thanks everybody for the suggestions. It seems that the cmd fonts don't have the specific characters I need, and this is why changing the code page did not solve my problem.
I found a way to add more monospaced fonts to the console, but after I add them any change that I want to do regarding the fonts (even choosing one of the original fonts in a different size) - is ignored.
I think that I will simply try with another tool, which supports chhosing a differnt font more easily.
AFAIK, CMD has perfect support for Unicode; you can enter/output all Unicode chars when any codepage is active.
The encoding of cmd does not support non-ASCII character. (Or the deeper layer does not support non-ASCII).
Reference: Java Unicode on Windows Command Line
Try chcp 1252
or chcp 65001
from the command line. With Lucida Console or other font support.
try CMD /c /U java your.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With