Unicode输出在Windows命令行? [英] Unicode output on Windows command line?
问题描述
我写了一个小的Java应用程序,其输出包括Unicode字符。当我使用Eclipse运行它—我看到所有的输出的预期。
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.
应该使用应用程序的人将运行它作为一个jar文件。我想他们可以使用标准的cmd窗口,但在这个窗口中的Unicode显示为Gibberish。
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.
有一种方法使cmd窗口识别Unicode字符和显示他们适当?
或者,有没有任何工具来轻松运行jar文件并获得正确的输出?
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 - 将输出重定向到文件工作正常,但程序是交互式的,因此这不会是一个很好的解决方案。
BTW - redirecting the output to a file works okay, but the program is interactive, so this will not be a good solution.
编辑:感谢大家的建议。
看来cmd字体没有我需要的特定字符,这就是为什么更改代码页没有解决我的问题。
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发现了方式可向控制台添加更多等宽字体,但是在我添加它们之后,我想对字体进行任何更改(即使选择不同大小的原始字体之一)。
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.
我认为
推荐答案
参考资料: Windows命令行上的Java Unicode
从命令行尝试 chcp 1252
或 chcp 65001
。与Lucida控制台或其他字体支持。
Try chcp 1252
or chcp 65001
from the command line. With Lucida Console or other font support.
这篇关于Unicode输出在Windows命令行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!