.netconsole.readkey

Reading Unicode with Console.ReadKey


Is it possible to provide Unicode input to a console app, and read the Unicode char/string via Console.ReadKey()?

I know Unicode works when reading the input via other methods, but unfortunately I need to use the 'interception' feature provided by ReadKey.

Update:

When pasting a Unicode character such as U+03BB (λ) into the console, 3 keys are read.

  1. Alt + NumPad1
  2. Alt + NumPad1
  3. Alt + NumPad8

I have tried to see if this is some kind of encoding, but can not see anything.


Solution

  • Now this just weird. IIRC my testing was on 32-bit, probably Vista.

    Now tested the same on Win7 64-bit, the bloody thing works!

    So either a Vista or 32-bit bug.

    Can someone please confirm this?