DosQueryDBCSEnv obtains a double-byte character set (DBCS) environment vector that resides in the country file. The default name of the country file is COUNTRY.SYS.
The vector corresponds to the system country code or selected country code, and to the process code page or selected code page.
The following code fragment shows how to use DosQueryDBCSEnv:
#define INCL_DOSNLS /* National Language Support values */ #include <os2.h> #include <stdio.h> ULONG ulLength; /* Length of data area provided */ COUNTRYCODE ccStructure; /* Input data structure */ UCHAR ucMemoryBuffer[12]; /* DBCS environmental vector (returned) */ APIRET ulrc; /* Return code */ ulLength = 12; /* A length of 12 bytes is sufficient */ /* to contain the DBCS data returned */ ccStructure.country = 0; /* Use the default system country code */ ccStructure.codepage = 0; /* Return DBSC information for the */ /* caller's current process code page */ ulrc = DosQueryDBCSEnv(ulLength, &ccStructure, ucMemoryBuffer); if (ulrc != 0) { printf("DosQueryDBCSEnv error: return code = %ld", ulrc); return; }
On successful return, the buffer MemoryBuffer will contain the country dependent information for the DBCS environmental vector.
Instead of the single-byte character set (SBCS) representation used for Latin text, some Asian countries use code pages that consist of double-byte character set characters, in which each character is represented by a two-byte code. The DBCS code pages enable single-byte data, double-byte data, or mixed (single-byte and double-byte) data.