Bug #9094

Curses.getch() function responds twice for unicode keys

Added by Johan Walles over 1 year ago. Updated about 1 year ago.

[ruby-core:58223]
Status:Third Party's Issue
Priority:Normal
Assignee:-
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

Description

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.

ruby-curses-getch.rb Magnifier - Example program (293 Bytes) Johan Walles, 11/08/2013 03:45 AM

History

#1 Updated by Hiroshi SHIBATA about 1 year ago

  • Status changed from Open to Third Party's Issue

curses is extracted from ruby-core. If you still have this issue, Please report to https://github.com/ruby/curses

Also available in: Atom PDF