gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 17:56:13 25 4
gpt4 key购买 nike

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

在 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/

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