From 20183fb965560d7d299d5f746bdeb5e2700f7e01 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 24 Mar 2014 19:16:49 +0000 Subject: Only change codepage of input character if top bit is set It seems that passing control characters through OemToCharBuff is not a good idea: some of them end up in the top half of the codepage. --- win32/termios.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32/termios.c b/win32/termios.c index 40e70309e..2b1d2c761 100644 --- a/win32/termios.c +++ b/win32/termios.c @@ -75,8 +75,10 @@ int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout) } continue; } - s = &record.Event.KeyEvent.uChar.AsciiChar; - OemToCharBuff(s, s, 1); + if ( (record.Event.KeyEvent.uChar.AsciiChar & 0x80) == 0x80 ) { + s = &record.Event.KeyEvent.uChar.AsciiChar; + OemToCharBuff(s, s, 1); + } ret = record.Event.KeyEvent.uChar.AsciiChar; break; } -- cgit v1.2.3-55-g6feb