gpt4 book ai didi

c++ - 在 visual studio 中显示 Unicode

转载 作者:太空宇宙 更新时间:2023-11-04 13:40:37 25 4
gpt4 key购买 nike

我已经尝试了几乎所有在 Visual Studio 2013、C++ 中显示 Unicode 的方法。

开始于:

cmd /K chcp 65001

更改 visual studio 中的“字符集”。

我很乐意得到一些帮助,告诉我应该做什么。

最佳答案

为了运行 UTF-8,您需要一个字节顺序标记 (BOM),有时称为签名。

Per the MSDN:

Unicode characters are now supported in identifiers, macros, string and character literals, and in comments. Universal character names are also now supported.

Unicode can be input into a source code file in the following encodings:

  • UTF-16 little endian with or without byte order mark (BOM)
  • UTF-16 big endian with or without BOM
  • UTF-8 with BOM

看在所有体面事物的份上,不要使用“带 BOM 的 UTF-8!”

您可以 do what was done here并通过转到“高级保存选项”并选择“不带 BOM 的 UTF-8”(签名)来简单地保存您需要的文件。这仅适用于逐个文件的文件,但有一个关于安装名为 File Fix Encoding 的讨论。 ,这将取消所有文件的 BOM。

换句话说——除非安装文件修复编码,否则只能逐个文件显示 UTF-8。

希望这对您有所帮助。

关于c++ - 在 visual studio 中显示 Unicode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27770229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com