[ruby-core:60611] [ruby-trunk - Bug #9094] [Third Party's Issue] Curses.getch() function responds twice for unicode keys

From: shibata.hiroshi@...
Date: 2014-02-09 04:45:06 UTC
List: ruby-core #60611
Issue #9094 has been updated by Hiroshi SHIBATA.

Status changed from Open to Third Party's Issue

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

----------------------------------------
Bug #9094: Curses.getch() function responds twice for unicode keys
https://bugs.ruby-lang.org/issues/9094#change-45051

* Author: Johan Walles
* Status: Third Party's Issue
* Priority: Normal
* Assignee:=20
* Category:=20
* Target version:=20
* 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 "=C3=A4" on your keyboard (Swedish layout needed for this)

Current result:
I get *two* separate results from Curses.getch(), which when merged form a =
unicode '=C3=A4'; 195 and 164.

Expected result:
I expected *one* result from Curses.getch() for my single keypress, contain=
ing a unicode '=C3=A4'.

Notes:
It seems as if Curses.getch() ends up in the NCurses getch() function at ht=
tp://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/curses/curses.c?revisio=
n=3D43316&view=3Dmarkup#l647 . Calling wgetch() instead may or may not help.


---Files--------------------------------
ruby-curses-getch.rb (293 Bytes)


--=20
http://bugs.ruby-lang.org/

In This Thread

Prev Next