unicode characters appear as question marks in IntelliJ IDEA console

后端 未结 8 2127
粉色の甜心
粉色の甜心 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:43

    1. Do what @Mike Nakis said in his answer with going to Settings and changing project Encoding.

    2. In my case I had to do an additional step:

    In the bottom right corner of IntelliJ IDEA switch encoding to UTF-8

    Note that if you had some text pasted in your class with a different encoding (in my case I pasted a block of Cyrillic text right from the browser) it will become ugly formatted but that's ok. Just remove it and after switching to UTF-8 put it back.

提交回复
热议问题