GetCPInfoExA function

Retrieves information about any valid installed or available code page.

Syntax

BOOL GetCPInfoExA(
  UINT        CodePage,
  DWORD       dwFlags,
  LPCPINFOEXA lpCPInfoEx
);

Parameters

CodePage

Identifier for the code page for which to retrieve information. The application can specify the code page identifier for any installed or available code page, or one of the following predefined values. See Code Page Identifiers for a list of identifiers for ANSI and other code pages.

Value Meaning
CP_ACP
Use the system default Windows ANSI code page.
CP_MACCP
Use the system default Macintosh code page.
CP_OEMCP
Use the system default OEM code page.
CP_THREAD_ACP
Use the current thread's ANSI code page.

dwFlags

Reserved; must be 0.

lpCPInfoEx

Pointer to a CPINFOEX structure that receives information about the code page.

Return Value

Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

The information retrieved in the CPINFOEX structure is not always useful for all code pages. To determine buffer sizes, for example, the application should call MultiByteToWideChar or WideCharToMultiByte to request an accurate buffer size. If CPINFOEX settings indicate that a lead byte exists, the conversion function does not necessarily handle lead bytes differently, for example, in the case of a missing or illegal trail byte.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header winnls.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

CPINFOEX

GetACP

GetCPInfo

GetOEMCP

National Language Support

National Language Support Functions