Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Ncurses in UTF-8 locale

 
   Soft32 Home -> Linux -> X Window System RSS
Next:  devfs_mk_dir: invalid argument...  
Author Message
Chris Jones

External


Since: Jun 01, 2009
Posts: 2



(Msg. 1) Posted: Mon Jun 01, 2009 9:20 am
Post subject: Ncurses in UTF-8 locale
Archived from groups: comp>os>linux>x (more info?)

I coded the following snippet:

#include <locale.h>
#include <ncurses.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int uc;

int main(void)
{
initscr();
raw();
keypad(stdscr, TRUE);
uc = getch();
mvprintw(24, 0, "Key code = %4x ", uc);
refresh();
getch();
endwin();
return 0;
}

This runs OK when locale is set to en_US but behaves unexpectedly when
set to en_US.utf8.

I tested on uxterm with:

Compose + E=

which is mapped to the euro symbol - 0x20ac.

When I enter this key combination, I am returned to the bash prompt with
an empty square/rectangle.

This runs OK if I hit any key that's mapped to an 8-bit encoded
character such as <space> .. 0, 1, .. etc.

Is this because there's something wrong with my testing, using the
Compose key or do I need to change the code above to get it to work in
a UTF-8 locale?

I played with the above, adding a setlocale(LC_ALL, "") .. linked to
libncursesw instead of linbncurses.. to no effect.

Since I saw no mention of UTF-8 in the ncurses manuals I was expecting
this to be transparent.

CJ
Back to top
Login to vote
Chris Jones

External


Since: Jun 01, 2009
Posts: 2



(Msg. 2) Posted: Tue Jun 02, 2009 7:20 pm
Post subject: Re: Ncurses in UTF-8 locale [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 01 Jun 2009 12:04:05 GMT, Chris Jones <cjns1989.RemoveThis@optimum.net> wrote:

[..]

Come to think of it, I may have assumed wrong & posted this request for
assistance in the wrong newsgroup - same developer as xterm and seems to
have at some point been shipped with Xfree86 - but since ncurses is not
X specific, perhaps s/o could suggest a better place?

CJ
Back to top
Login to vote
Display posts from previous:   
Related Topics:
ncurses 5.5 - Hey folks, ncurses 5.5 fails to build because it tries to build 64bit libraries. Should be an easy fix if someone..

Ncurses lässt_sich_nicht_installieren - Hallo zusammen, bezüblich des Problems mit Yast (siehe vorherigen Post) habe ich versucht Ncurses neu zu installieren...

[gentoo-dev] slang v.s. ncurses - This is not supposed to start a flame-fest, but I need some advice. As of mutt-1.5.10-r1, the slang use flag is ignore...

[gentoo-user] Bootstrapping and Ncurses - Alright, so I started a fresh installation one of my laptops. On my first attempt I used the experimental..

[gentoo-user] Compiling Ncurses - Hi again. I'd like to remove a little of what I said from before (it hasn't shown up to me yet from gentoo-user list, s...

ncurses relocation error at login - Greetings, I receive the following error upon login: tput: relocation error: tput: undefined symbol: _nc_rootname It...
       Soft32 Home -> Linux -> X Window System All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]