unicode characters appear as question marks in IntelliJ IDEA console

后端 未结 8 2141
粉色の甜心
粉色の甜心 2020-12-11 15:26

I\'m trying to write unicode characters (♠) using System.out, and a question mark gets printed instead.

How can I have proper unicode characters displayed instead o

8条回答
  •  醉话见心
    2020-12-11 15:52

    Go to Help > Edit Custom VM options... then add the following option:

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

    I'm not sure if both are necessary but it worked for me. You need to restart IntelliJ for changes to be applied.

    I had already tried changing every encoding setting in Intellij, setting those options in Gradle and changing the system encoding, this is the only one that worked.

提交回复
热议问题