Unicode 字符在 IntelliJ IDEA 控制台中显示为问号 [英] unicode characters appear as question marks in IntelliJ IDEA console

查看:131
本文介绍了Unicode 字符在 IntelliJ IDEA 控制台中显示为问号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 System.out 编写 unicode 字符 (♠),结果打印出一个问号.

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

如何显示正确的 unicode 字符而不是问号?

How can I have proper unicode characters displayed instead of question marks?

我在 Windows 上使用 IntelliJ IDEA,并尝试从 IDE 中打印.

I'm using IntelliJ IDEA on Windows, and trying to print from within the IDE.

推荐答案

文件编码配置是否正确?请参阅设置 | 文件编码"使用 UTF-8.当我有 IDE 编码并且所有文件都设置为 UTF-8 时,打印 ♠ 对我有用.更改编码后可能需要重新编译.

Is the file encoding configured correctly? See that "Settings | File Encodings" uses UTF-8. Printing ♠ works for me when I have IDE encoding and all files set to UTF-8. Recompiling may be needed after changing the encoding.

这篇关于Unicode 字符在 IntelliJ IDEA 控制台中显示为问号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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