简体   繁体   English

IntelliJ IDEA 控制台问题

[英]IntelliJ IDEA console issue

My laptop suffered a hard drive failure and i had to re-install IntelliJ and windows on a new hard drive.我的笔记本电脑硬盘出现故障,我不得不在新硬盘上重新安装 IntelliJ 和 windows。 In my old drive i was able to print (system.out.println) foreign languages in the console without any issues, but after the re-installation my console is not recognizing the text and i get an output like this在我的旧驱动器中,我能够在控制台中打印 (system.out.println) 外语而没有任何问题,但是在重新安装后,我的控制台无法识别文本,我得到了这样的输出

????????????? ???? |
??????????-??? ??_???????-???

?????? ???????:
?????: ?????????-?????
????????? ??-?? ? 1-1 ?

i dont think its due to any error in my source, is there any way to configure my IDE to be able to recognize this text ( tamil in this instance but i need to support a large number of languages )我不认为这是由于我的源代码中的任何错误造成的,有没有办法配置我的 IDE 以能够识别此文本(在这种情况下是泰米尔语,但我需要支持大量语言)

Thanks in advance, Sumal.提前致谢,苏马尔。

The proposed solution wasn't working for me. 建议的解决方案对我不起作用。 Even though I've set the IDE encoding & Project encoding to UTF-8 in Idea's Settings, the console continued to not display properly the characters. 即使我在Idea的设置中将IDE编码和项目编码设置为UTF-8,控制台仍然无法正确显示字符。 So for other people in the same situation I'm going to post another solution which worked for me. 所以对于处于相同情况的其他人,我将发布另一个对我有用的解决方案。

You need to find the idea executable file. 您需要找到想法可执行文件。 On Windows it's probably under "C:\\Program Files (x86)\\JetBrains\\IntelliJ IDEA 14.1.5\\bin". 在Windows上,它可能位于“C:\\ Program Files(x86)\\ JetBrains \\ IntelliJ IDEA 14.1.5 \\ bin”下。 In the file "idea.exe.vmoptions" you need to add the following line: 在文件“idea.exe.vmoptions”中,您需要添加以下行:

-Dfile.encoding=UTF-8

Check if you have selected an IDE encoding that supports foreign languages. 检查您是否选择了支持外语的IDE编码。

Settings → File Encoding → Project Encoding → IDE Encoding

There, select UTF-8 . 在那里,选择UTF-8

对于 x64 版本的可执行文件,您必须找到文件idea64.exe.vmoptions ,并像其他人提到的那样添加-Dfile.encoding=UTF-8行。

In Help / Edit Custom VM Options... add:Help / Edit Custom VM Options...添加:

-Dconsole.encoding=UTF-8
-Dfile.encoding=UTF-8

...and restart IDE :) ...并重新启动IDE :)


You can also edit file manualy from:您还可以从以下位置手动编辑文件:

  • C:\\Program Files\\JetBrains\\IntelliJ IDEA\\bin\\idea64.exe.vmoptions

or或者

  • C:\\Users\\[YOUR_USER_NAME]\\AppData\\Roaming\\JetBrains\\IntelliJIdea2021.2\\idea64.exe.vmoptions

depending on what config file uses your IDE.取决于使用您的 IDE 的配置文件。


If you are using x86 version the file is named accordingly如果您使用的是 x86 版本,则相应地命名该文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM