c - unsigned char 140, unicode 0x0152 = 338 的代码页或编码是什么?

标签 c visual-c++ encoding

可能是程序员阅读了编码基础知识,但我的具体问题是

在 Windows Visual C 输出到 Windows 控制台中,无符号字符值 140 打印为 unicode 0x0152 = 338。

Visual C 使用什么编码(或“代码页”?)? (例如 UTF-7、ASCII)。 unsigned char 值 140 到底如何映射到 unicode 字符 338?

我确信任何人都可以粘贴指向有关编码的众多维基百科页面之一的链接或 tables在网络上,但对这个问题有更具体的答案会很好。

最佳答案

这将是编码Windows-1252 ,并不是 Visual C 正在“使用”它,而是 Windows 控制台将输出解释为它。

这个其他答案可能就是您想要的:What encoding/code page is cmd.exe using?

“代码页”是 Microsoft 的“编码字符集”术语,它或多或少相当于您所认为的“编码”,但请参阅 Unicode Glossary以获得精确的定义。

并引用维基百科页面:

Historically, the phrase "ANSI code page" (ACP) is used in Windows to refer to various code pages considered as native. The intention was that most of these would be ANSI standards such as ISO-8859-1. Even though Windows-1252 was the first and by far most popular code page named so in Microsoft Windows parlance, the code page has never been an ANSI standard. Microsoft-affiliated bloggers now state that "The term ANSI as used to signify Windows code pages is a historical reference, but is nowadays a misnomer that continues to persist in the Windows community."

关于c - unsigned char 140, unicode 0x0152 = 338 的代码页或编码是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13733536/

相关文章:

c - 在 C 编程中编辑和删除输入

c++ - 如何从Visual C++中获取具体的windows服务可执行文件路径

encoding - 在 Sublime Text 3 中将文件编码设置为带 BOM 的 UTF8

encoding - 如何在使用 ffmpeg 进行实时 rtmp 发布期间自适应地将编码比特率更改为带宽?

python - 无法打开使用 PyInstaller 创建的桌面应用程序

C/Youtube API 请求 > VLC

c - 使用变量定义数组大小(代码块)

c++ - 错误 C7034 : an array cannot be initialized with a parenthesized initializer

c - 链接目标文件和链接包含这些文件的静态库

sql - 使用 OLEDB select 语句获取错误值