Microsoft KB Archive/99795

{|
 * width="100%"|

INFO: SetConsoleOutputCP Only Effective with Unicode Fonts

 * }

Q99795

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * the operating system: Microsoft Windows NT, versions 3.51, 4.0
 * the operating system: Microsoft Windows 2000

-

SUMMARY
SetConsoleOutputCP changes the displaying of extended characters in a console window only if the current font is a fixed-pitch Unicode font. It does not effect the displaying of extended characters of the console font named &quot;Raster Font.&quot;

MORE INFORMATION
SetConsoleOutputCP is designed to change the mapping of the 256 8-bit character values into the glyph set of a fixed-pitch Unicode font, rather than loading a separate, non-Unicode font for each call to SetConsoleOutputCP. For Windows NT 3.51, Windows NT 4.0, and Windows 2000 the currently available Unicode console font is the Lucida Console TrueType font.

To demonstrate SetConsoleOutputCP, implement a console application that calls this API. After a successful return from this function, call printf to display characters of ASCII value greater than 127.

The Win32 Platform SDK also ships with a Sample called CONSOLE in the \samples\WinUI\Console\Console directory that demonstrates the use of the SetConsoleOutputCP API.

Additional query words: winnt codepage

Keywords : kbprogramming kbAPI kbConsole kbKernBase kbOSWinNT351 kbOSWinNT400 kbOSWin2000 kbDSupport kbGrpDSKernBase

Issue type : kbinfo

Technology : kbAudDeveloper kbWin32sSearch kbWin32API