注意:我已经在AskDivent上问了这个问题,并且作为关闭主题而被关闭。
我正在考虑编写C程序(或者是程序生成器),该程序需要处理Unicode文本。仅处理UTF-8就足够了,但是处理其他编码也很不错。为此,我需要知道宽字符的C库API如何工作。为了进行比较,这是GNU库的那些API的写作非常好的说明:
https://www.gnu.org/software/libc/manual/manual/html_node/ususe-wide-char-classes.html
and
和
和
特别是,GNU库选择在Unicode代码点和 WCHAR_TCHAR_T.
值,但这显然不是唯一可能的选择。我该如何确定达尔文图书馆在这些方面做什么?是否有与我引用的GNU手册相当范围的文件?
更一般而言,是否有GNU信息或HTML手册之类的东西,但是涵盖了Darwin Libc?我意识到,大多数正常用途都将被POSIX和相关标准所涵盖,但是当然,这些用途会留下很多开放的问题,例如上述问题。
Note: I have asked this on AskDifferent, and it was closed as off topic.
I am thinking of writing a C program (or rather, a program generator) which will need to process Unicode text. It will be sufficient to process just UTF-8, but it would be nice to handle other encodings as well. In order to do this I need to know how the C library API for wide characters works. For comparison, here is a very well written and detailed explanation of those APIs for the GNU library:
https://www.gnu.org/software/libc/manual/html_node/Using-Wide-Char-Classes.html
and
https://www.gnu.org/software/libc/manual/html_node/Extended-Char-Intro.html
and
https://www.gnu.org/software/libc/manual/html_node/Streams-and-I18N.html
In particular, the GNU library chooses to have a 1-1 mapping between Unicode code points and wchar_t
values, but this is clearly not the only possible choice. How can I determine what the Darwin library does in these respects? Is there a document of comparable scope to the GNU manual I quoted?
More generally, is there anything like the GNU Info or HTML manuals for the glibc, but covering the Darwin libc? I realize that most normal use will be covered by POSIX and related standards, but of course those leave a lot of things open, such as the issues mentioned above.
发布评论