[笔记]使用API函数 GetACP 获取Windows系统当前代码页

Windows API 函数 GetACP 可以获得当前系统的代码页编码,如简体中文是 936。

如果要获得 Dos 下的代码页,则需要调用 GetOEMCP 函数。

如果要判断代码页的有效性,调用 IsValidCodePage 函数。

以上函数在 Delphi 中需要引用 Windows 单元。

参考:

  1. How can I read the current code page of system?
    http://www.scalabium.com/faq/dct0082.htm
posted @ 2011-07-14 00:17  ET民工[源自火星]  阅读(4297)  评论(0编辑  收藏  举报