什么是ANSI编码格式?它是系统默认格式吗? 它和ASCII有什么不同?


当前回答

ANSI(又名Windows-1252/WinLatin1)是拉丁字母的字符编码,非常类似于ISO-8859-1。 你可以去维基百科上看看。

其他回答

如果你的电脑不是“西方”电脑,你不知道使用哪个代码页,你可以看看这个页面:国家语言支持(NLS) API参考

[微软删除了此引用,将其从web存档的国家语言支持(NLS) API引用中取出

或者您可以查询您的注册表:

C:\>reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage /f ACP

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
    ACP    REG_SZ    1252

End of search: 1 match(es) found.

C:\>

Once upon a time Microsoft, like everyone else, used 7-bit character sets, and they invented their own when it suited them, though they kept ASCII as a core subset. Then they realised the world had moved on to 8-bit encodings and that there were international standards around, such as the ISO-8859 family. In those days, if you wanted to get hold of an international standard and you lived in the US, you bought it from the American National Standards Institute, ANSI, who republished international standards with their own branding and numbers (that's because the US government wants conformance to American standards, not international standards). So Microsoft's copy of ISO-8859 said "ANSI" on the cover. And because Microsoft weren't very used to standards in those days, they didn't realise that ANSI published lots of other standards as well. So they referred to the standards in the ISO-8859 family (and the variants that they invented, because they didn't really understand standards in those days) by the name on the cover, "ANSI", and it found its way into Microsoft user documentation and hence into the user community. That was about 30 years ago, but you still sometimes hear the name today.

严格地说,没有所谓的ANSI编码。通俗地说,术语ANSI用于几种不同的编码:

ISO 8859 - 1 Windows CP1252 Windows机器上的当前系统编码(用Win32 API术语)。

从技术上讲,ANSI应该与US-ASCII相同。它指的是ANSI X3.4标准,这只是ANSI组织批准的ASCII版本。顶部位集字符的使用在ASCII/ANSI中没有定义,因为它是一个7位字符集。

然而,多年来DOS和随后的Windows社区对该术语的误用,已经使其实际含义成为“正在使用的任何机器的系统代码页”。系统码页有时也被称为“mbcs”,因为在东亚系统中,它可以是每个字符多字节编码。一些代码页甚至可以使用顶部清除字节作为多字节序列中的尾随字节,因此它甚至不严格兼容纯ASCII…但即使这样,它仍然被称为“ANSI”。

在美国和西欧的默认设置中,“ANSI”映射到Windows代码页1252。这与ISO-8859-1不同(尽管它们非常相似)。在其他机器上,它可能是其他任何东西。这使得“ANSI”作为外部编码标识符完全无用。

ANSI(又名Windows-1252/WinLatin1)是拉丁字母的字符编码,非常类似于ISO-8859-1。 你可以去维基百科上看看。