简体   繁体   English

如何在 VS Code 的集成终端中正确显示 unicode 字符?

[英]How to correctly display unicode characters in VS Code's Integrated Terminal?

As per title, I can't seem to get VS Code Integrated Terminal to correctly display unicode characters.根据标题,我似乎无法让 VS Code 集成终端正确显示 unicode 字符。 They always show up as question marks (?) in the integrated terminal.它们在集成终端中始终显示为问号 (?)。

I've ensured that the files are saved with encoding UTF-8 which seemed to be the only solution suggested across all the answers I've seen so far, but to no avail.我确保文件以UTF-8编码保存,这似乎是迄今为止我看到的所有答案中建议的唯一解决方案,但无济于事。

System.out.println("A unicode check mark character is supposed to look like this: \u2713");

Expected output : "A unicode check mark character is supposed to look like this: ✓"预期输出:“Unicode 复选标记字符应该如下所示:✓”

Actual output : "A unicode check mark character is supposed to look like this: ?"实际输出:“Unicode 复选标记字符应该如下所示:?”

在 VS Code 集成终端中,输入命令: chcp 65001然后它应该正确显示 unicode。

Since vscode uses xterm you will need to add a fallback icon font like FontAwesome mine is like this:由于 vscode 使用 xterm,你需要添加一个后备图标字体,比如我的 FontAwesome 是这样的:

"Cascadia Mono", "FontAwesome"

This will fix it这将解决它

Here is a screenshot:这是一个屏幕截图: 在此处输入图片说明

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

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