c++ - Windows 上的 native 窄字符串编码是什么?

标签 c++ c string winapi character-encoding

Subversion API 有一个 number of functions用于将“本地编码”字符串转换为以 UTF-8 编码的字符串。我的问题是:Windows 上的 native 编码是什么?它取决于语言环境吗?

最佳答案

“ native 编码”字符串是用任何 code page 编写的字符串用户正在使用。也就是说,它们是根据正确的代码页转换为适当字形的数字。假设文件是​​以这种方式保存的,而不是保存为 UTF-8 文件。

这是 Joel's article on Unicode 的候选问题.

具体来说:

Eventually this OEM free-for-all got codified in the ANSI standard. In the ANSI standard, everybody agreed on what to do below 128, which was pretty much the same as ASCII, but there were lots of different ways to handle the characters from 128 and on up, depending on where you lived. These different systems were called code pages. So for example in Israel DOS used a code page called 862, while Greek users used 737. They were the same below 128 but different from 128 up, where all the funny letters resided. The national versions of MS-DOS had dozens of these code pages, handling everything from English to Icelandic and they even had a few "multilingual" code pages that could do Esperanto and Galician on the same computer! Wow! But getting, say, Hebrew and Greek on the same computer was a complete impossibility unless you wrote your own custom program that displayed everything using bitmapped graphics, because Hebrew and Greek required different code pages with different interpretations of the high numbers.

关于c++ - Windows 上的 native 窄字符串编码是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4649388/

相关文章:

c# - DateTime.ParseExact 返回 FormatException

string - 通过正则表达式拆分字符串以获得 Vec<String>

C++以两种不同的方式从类中实例化一个对象

c++ - std::bind 和函数模板

java - 用于列出源文件中所有函数的 linux 工具?

c++ - 线程意外结束。 C++

c - DialogBox 未正确呈现?

c - 我第一次使用链表。想要一些关于如何解决某些问题的批评和建议

c - 将输入放入数组c程序中

c - 如何确保套接字 I/O 的 NULL 终止字符串 C 编程