Export (0) Print
Expand All
Expand Minimize

EnumSystemCodePages function

Enumerates the code pages that are either installed on or supported by an operating system.

Syntax


BOOL EnumSystemCodePages(
  _In_  CODEPAGE_ENUMPROC lpCodePageEnumProc,
  _In_  DWORD dwFlags
);

Parameters

lpCodePageEnumProc [in]

Pointer to an application-defined callback function. The EnumSystemCodePages function enumerates code pages by making repeated calls to this callback function. For more information, see EnumCodePagesProc.

dwFlags [in]

Flag specifying the code pages to enumerate. This parameter can have one of the following values, which are mutually exclusive.

ValueMeaning
CP_INSTALLED

Enumerate only installed code pages.

CP_SUPPORTED

Enumerate all supported code pages.

 

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_BADDB. The function could not access the data. This situation should not normally occur, and typically indicates a bad installation, a disk problem, or the like.
  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

This function enumerates the code pages by passing code page identifiers, one at a time, to the specified application-defined callback function. This process continues until all installed or supported code page identifiers have been passed to the callback function, or the callback function returns FALSE.

When an application is using this function to determine an appropriate code page for saving data, it should use Unicode when possible. Other code pages are not as portable as Unicode between vendors or operating systems, due to different implementations of the associated standards.

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

EnumSystemCodePagesW (Unicode) and EnumSystemCodePagesA (ANSI)

See also

National Language Support
National Language Support Functions
EnumCodePagesProc

 

 

Community Additions

ADD
Show:
© 2014 Microsoft