INFO: SetConsoleOutputCP Only Effective with Unicode Fonts

This article was previously published under Q99795
This article has been archived. It is offered "as is" and will no longer be updated.
SetConsoleOutputCP() changes the displaying of extended characters in aconsole window only if the current font is a fixed-pitch Unicode font. Itdoes not effect the displaying of extended characters of the console fontnamed "Raster Font."
SetConsoleOutputCP() is designed to change the mapping of the 256 8-bitcharacter values into the glyph set of a fixed-pitch Unicode font, ratherthan loading a separate, non-Unicode font for each call toSetConsoleOutputCP(). For Windows NT, Windows 2000, and Windows XP the currently available Unicode console font is the Lucida Console TrueType font.

To demonstrate SetConsoleOutputCP(), implement a console application thatcalls this API. After a successful return from this function, call printfto display characters of ASCII value greater than 127.

The Win32 Platform SDK also ships with a Sample calledCONSOLE in the \samples\WinUI\Console\Console directory that demonstrates the useof the SetConsoleOutputCP() API.
winnt codepage

Article ID: 99795 - Last Review: 02/28/2014 00:26:47 - Revision: 3.1

  • Microsoft Win32 Application Programming Interface
  • kbnosurvey kbarchive kbinfo kbapi kbconsole kbprogramming kbkernbase KB99795