DosQueryCp is used to determine the code page of the current process and the prepared system code pages. The following code fragment shows how to get the current code page, and then up to three other prepared pages:
#define INCL_DOSNLS /* National Language Support values */ #include <os2.h> ULONG ulCpList[8]; ULONG ulCpSize; APIRET ulrc; /* Return code */ ulrc = DosQueryCp(sizeof(ulCpList), /* Length of list */ ulCpList, /* List */ &ulCpSize); /* Length of returned list */
The required code page is the current code page of the process at the time it opens a device, or a specific code page selected by the process with a set-code-page function. A character set can also be specified for some devices, for example, for some printers.
The country functions retrieve country- and language-dependent information in the current code page of the calling process, or in a code page selected by the process.