Export (0) Print
Expand All
Expand Minimize

GetCPInfoEx function

Retrieves information about any valid installed or available code page.

Syntax


BOOL GetCPInfoEx(
  _In_   UINT CodePage,
  _In_   DWORD dwFlags,
  _Out_  LPCPINFOEX lpCPInfoEx
);

Parameters

CodePage [in]

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.

ValueMeaning
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 [in]

Reserved; must be 0.

lpCPInfoEx [out]

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 | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Winnls.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

GetCPInfoExW (Unicode) and GetCPInfoExA (ANSI)

See also

National Language Support
National Language Support Functions
GetACP
GetCPInfo
GetOEMCP
CPINFOEX

 

 

Community Additions

ADD
Show:
© 2014 Microsoft