Skip to content

Latest commit

 

History

History
81 lines (60 loc) · 2.56 KB

getconsolecp.md

File metadata and controls

81 lines (60 loc) · 2.56 KB
title description author ms.author ms.topic keywords f1_keywords MS-HAID MSHAttr ms.assetid topic_type api_name api_location api_type
GetConsoleCP function
Retrieves the input code page used by the console associated with the calling process.
miniksa
miniksa
article
console, character mode applications, command line applications, terminal applications, console api
consoleapi/GetConsoleCP
wincon/GetConsoleCP
GetConsoleCP
\_win32\_getconsolecp
base.getconsolecp
consoles.getconsolecp
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
9e0af6d9-0f5c-45b3-a686-22449d26de47
apiref
GetConsoleCP
Kernel32.dll
API-MS-Win-Core-Console-l1-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
DllExport

GetConsoleCP function

Retrieves the input code page used by the console associated with the calling process. A console uses its input code page to translate keyboard input into the corresponding character value.

Syntax

UINT WINAPI GetConsoleCP(void);

Parameters

This function has no parameters.

Return value

The return value is a code that identifies the code page. For a list of identifiers, see Code Page Identifiers.

If the return value is zero, the function has failed. To get extended error information, call GetLastError.

Remarks

A code page maps 256 character codes to individual characters. Different code pages include different special characters, typically customized for a language or a group of languages. To retrieve more information about a code page, including it's name, see the GetCPInfoEx function.

To set a console's input code page, use the SetConsoleCP function. To set and query a console's output code page, use the SetConsoleOutputCP and GetConsoleOutputCP functions.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header ConsoleApi.h (via WinCon.h, include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Console Code Pages

Console Functions

GetConsoleOutputCP

SetConsoleCP

SetConsoleOutputCP