Microsoft KB Archive/329019

= The WriteConsoleInput Function May Not Work for Characters in Extended ASCII Range 128 to 255 =

PSS ID Number: 329019

Article Last Modified on 1/10/2003

-

The information in this article applies to:


 * Microsoft Windows 2000 Professional SP3
 * Microsoft Windows 2000 Server SP3
 * Microsoft Windows 2000 Advanced Server SP3
 * Microsoft Windows XP Professional SP1
 * Microsoft Windows XP Home Edition SP1

-



This article was previously published under Q329019



SYMPTOMS
If you use the ANSI versions of the ReadConsoleInput and WriteConsoleInput console functions in your program, these functions may not print the correct characters on the console for extended ASCII characters in the range from 128 to 255. For example, if your program uses the ReadConsoleInput function to capture the user's keystrokes and then passes those keystrokes to the WriteConsoleInput function, some ALT+number pad key combinations may not appear correctly. If the user presses ALT+130, the program may print a question mark ( ?) on the console instead of an &quot;e&quot; with an accent.



CAUSE
Windows uses Unicode version 3.0, which does not define the extended ASCII character set range from 128 to 255 (Unicode character codes from 0x80 to 0xA0). When you press ALT+130 (or any key combination that includes the number pad), Unicode character codes in the range from 0x80 to 0xA0 are generated. Therefore, the ReadConsoleInput function uses the Unicode translation table to translate the Unicode character code to a corresponding character. Because Unicode does not define Unicode character codes from 0x80 to 0xA0, all the Unicode character codes in the range from 0x80 to 0xA0 are set to 0x3f (the question mark character) in the translation table. Therefore, the ReadConsoleInput function translation results in to 0x3f. When you pass 0x3f to the WriteConsoleInput function, it prints &quot;?&quot; on the console instead of an &quot;e&quot; with an accent.



WORKAROUND
You may be able to resolve this issue by using the Unicode versions of the ReadConsoleInputW and WriteConsoleInputW console functions in your program.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Keywords: kbprb KB329019

Technology: kbwin2000AdvServ kbwin2000AdvServSearch kbWin2000AdvServSP3 kbwin2000Pro kbwin2000ProSearch kbWin2000ProSP3 kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbwin2000ServSP3 kbWinAdvServSearch kbWinXPHome kbWinXPHomeSearch kbWinXPHomeSP1 kbWinXPPro kbWinXPProSearch kbWinXPProSP1 kbWinXPSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.