ReadConsoleInputA doesn't return correct double-byte characters in Windows 8 and Windows 10

Symptoms
When you run the ReadConsoleInputA function in Windows 8 or Windows 10, the function fails to return the correct double-byte characters (DBCS). Applications that use the ReadConsoleInputA function to read keyboard input from the console may experience unexpected behavior, or they may crash. Applications that call C run-time functions such as _getch() are also affected.
Cause
The ReadConsoleInputA function does not advance to the second character code of a DBCS character when a single INPUT_RECORD structure is read in each call.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Workaround
To work around this issue, use one of the following methods: 
  • Use the ReadConsoleInputW function or the corresponding Unicode version of the C run-time function, such as _getwch().
  • Read two INPUT_RECORD structures when you call ReadConsoleInputA.
Properties

Article ID: 3165318 - Last Review: 05/19/2016 19:42:00 - Revision: 1.0

Windows 8, Windows 8.1, Windows 10

  • KB3165318
Feedback