From: "walles (Johan Walles)" Date: 2013-11-08T03:45:34+09:00 Subject: [ruby-core:58223] [ruby-trunk - Bug #9094][Open] Curses.getch() function responds twice for unicode keys Issue #9094 has been reported by walles (Johan Walles). ---------------------------------------- Bug #9094: Curses.getch() function responds twice for unicode keys https://bugs.ruby-lang.org/issues/9094 Author: walles (Johan Walles) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.1.0dev (2013-10-30 trunk 43476) [x86_64-darwin13.0.0] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN Try this: 1. Write a curses program (or use the attached one). 2. Call Curses.getch() 3. Press "��" on your keyboard (Swedish layout needed for this) Current result: I get *two* separate results from Curses.getch(), which when merged form a unicode '��'; 195 and 164. Expected result: I expected *one* result from Curses.getch() for my single keypress, containing a unicode '��'. Notes: It seems as if Curses.getch() ends up in the NCurses getch() function at http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/curses/curses.c?revision=43316&view=markup#l647 . Calling wgetch() instead may or may not help. -- http://bugs.ruby-lang.org/