bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: 13 versus 343


From: g.hohl
Subject: AW: 13 versus 343
Date: Mon, 30 Apr 2018 10:35:54 +0200

Hello Folkert,
hello Michael,

@Michael:
Yeah, my bad. It's 0D of course, not 0A. Somehow I mixed them in my response.

@Folkert:
I'm not 100% sure because some time passed since I used NCurses the last time.
But I found the following:
http://www.cs.ukzn.ac.za/~hughm/os/notes/ncurses.html#input
They say:
> Special keys. If you have called keypad(stdstr, TRUE), then if the user hits 
> a special key such as the Delete key, the arrow keys, Ctrl combined keys and 
> function keys, a single int value will be returned.

So I guess you have to activate them before you're being able to use them.
But I'm not sure how you can distinguish between these special keys and the 
real UTF-8 values.
If you have a pure 8-Bit ASCII environment it is surely not a problem as you 
have no character after 255.
So 343 would be perfectly fine. But UTF-8 has that character...


Regards,
Gerrit

-----Ursprüngliche Nachricht-----
Von: Michael D. Setzer II [mailto:address@hidden 
Gesendet: Montag, 30. April 2018 10:31
An: Hohl, Gerrit
Betreff: Re: 13 versus 343

Just a note: 13 Dec is 0D Hex 
0A Hex is the Line Feed, 0D is Carriage return.

ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
000A;<control>;Cc;0;B;;;;;N;LINE FEED (LF);;;;
000B;<control>;Cc;0;S;;;;;N;LINE TABULATION;;;;
000C;<control>;Cc;0;WS;;;;;N;FORM FEED (FF);;;;
000D;<control>;Cc;0;B;;;;;N;CARRIAGE RETURN (CR);;;;

-----Ursprüngliche Nachricht-----
Von: folkert [mailto:address@hidden 
Gesendet: Montag, 30. April 2018 10:28
An: Hohl, Gerrit
Cc: address@hidden
Betreff: Re: 13 versus 343

Hi Gerrit,

I'm expecting 343 as that is KEY_ENTER which is the ncurses key-code for
enter. Well, that is what I think it is :-)

On Mon, Apr 30, 2018 at 10:26:21AM +0200, address@hidden wrote:
> Hello Folkert,
> 
> I'm not sure why you expect 343.
> Dec. 13 (Hex 0A) is a legal UTF-8 code for Enter.
> 
> Dec. 343 (Hex 01 57) is the "latin small letter r with cedilla": ??
> I guess you'll never get this one.
> 
> Dec. 205 131 (Hex 03 43) is the "conbining Greek koronis": ??
> So I guess you don't mean that one.
> 
> 
> Regards,
> Gerrit
> 
> -----Ursprüngliche Nachricht-----
> Von: Bug-ncurses [mailto:address@hidden Im Auftrag von folkert
> Gesendet: Montag, 30. April 2018 10:16
> An: address@hidden
> Betreff: 13 versus 343
> 
> Hi,
> 
> When I press enter, get_wch() returns 13 instead of 343.
> I link against ncursesw (and panelw) and I invoked
> setlocale(LC_ALL, "");
> before initting ncurses.
> Is this to be expected?
> 
> What I'm trying to achieve is that users can input non-ascii (utf8 etc).
> 
> 
> Folkert van Heusden
> 
> -- 
> 
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-ncurses


Folkert van Heusden

-- 
Multi tail barnamaj mowahib li mora9abat attasjilat wa nataij awamir
al 7asoub. damj, talwin, mora9abat attarchi7 wa ila akhirih.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]