控制台输出中的 IntelliJ IDEA 编码不正确 [英] IntelliJ IDEA incorrect encoding in console output

查看:39
本文介绍了控制台输出中的 IntelliJ IDEA 编码不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎真的很疯狂,但我无法在 IntelliJ IDEA 的控制台中对损坏的编码做任何事情.

It seems to be really crazy, but I can't do anything with broken encoding in the console of my IntelliJ IDEA.

我为克服这个问题所做的事情:

Things I made to overcome this:

  1. idea.exe.vmoptions-Dfile.encoding=UTF-8 中设置 -Dfile.encoding=UTF-8-Dfile.encoding=UTF-8idea64.exe.vmoptions(不过我使用的是 64 位版本).
  2. 添加了 -Dfile.encoding=UTF-8-Dfile.encoding=UTF-8 来运行/调试我的应用程序的配置.
  3. 更改的设置 >编辑器文件编码 IDE 编码/项目编码/属性文件的默认编码为 UTF-8.
  1. Set -Dfile.encoding=UTF-8 and -Dfile.encoding=UTF-8 in both idea.exe.vmoptions and idea64.exe.vmoptions (I use 64 bit version though).
  2. Added -Dfile.encoding=UTF-8 and -Dfile.encoding=UTF-8 to run/debug configuration of my application.
  3. Changed Settings > Editor > File encodings IDE Encoding/Project Encoding/Default encoding for property files to UTF-8.

完成所有这些后,仍然没有运气,并且符号未在控制台中正确显示.我试图调试 java.io.PrintStream#println(java.lang.String) 方法并发现 System.out.textOut.out.se.cs 等于到 windows-1251.不知道这个值是从哪里来的.

Having all these done, there is still no luck and symbols are not shown correctly in the console. I tried to debug the java.io.PrintStream#println(java.lang.String) method and found out that System.out.textOut.out.se.cs equals to windows-1251. No idea where this value is coming from.

这个问题困扰了我很长时间,我无法在网上找到任何可以帮助我的东西.

This issue has been bothering me for a long time and I was unable to find anything in the web that could help me.

推荐答案

这对我有用.

  1. 关闭你的智能想法
  2. 在安装的idea中搜索并打开idea.exe.vmoptions文件,例如:C:Program FilesJetBrainsIntelliJ IDEA 2018.3.2in".添加下一行后:-Dfile.encoding=UTF-8
  3. (可选)如果您有idea64.exe.vmoptions 文件,也添加相同的行.
  4. 开始您的智能创意.

这篇关于控制台输出中的 IntelliJ IDEA 编码不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆