LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   ncurses wide character/extended ASCII problem (https://www.linuxquestions.org/questions/programming-9/ncurses-wide-character-extended-ascii-problem-279479/)

Hosiah 01-18-2005 06:39 PM

ncurses wide character/extended ASCII problem
 
OK, I've been driving myself dingy with this one.

I'm trying to get some (wide character, Unicode, extended ASCII, even just ring the dumbbell) character that extends beyond what you can type from the keyboard to display in ncurses.

For one thing, after fruitless attempts to use add_wch() and such, about which I have oodles of man pages and documentation about, I read my ncurses.h file and found no definition of any of the wide character functions or macros at all. I have version 5.3

Next, I've tried forgetting the curses and tried just getting any extended ASCII character with a printf("%c",n) call. All I get are ^C ^H control characters.

Now, I know the number one question, and yes, my hardware is fully capable of supporting extended characters, Unicode and all. How I found that out is by typing "cat /dev/random " at the prompt, and my terminal beeps some and floods with all kinds of foreign language doohickeys and pound signs and hearts,clubs,spades,and diamonds.....

So, my terminal can display them and my Linux is set up to know how. Why can't I?

For the record: I'm using Red Hat Linux 9.0, gcc compiler, and I'm only using the '-lcurses' option. Is there some other link I should use?

Drunkalot 04-11-2005 05:54 AM

Does you solve the problem??? I'm having the same problem, I try to make a box and the ascii character is code 205, but instead of printing the especial chareacter I'm getting an Í...

This happens to any extended ascii character...

thx...

Hosiah 04-14-2005 05:25 AM

No, I never solved it. I gave up! )-:

I did chase it all the way down to a bug report on Bugzilla, which is left unresolved to this day. I think we're going to have to wait for the ncurses maintainer to release a new version, which hopefully will address this issue.

javicho 03-03-2009 12:55 PM

posible solucion EXTENDED ASCII
 
Hello!

I was trying with:

Code:

#include <ncurses.h>
#include <stdlib.h>

int main()
{
  unsigned short a;
  initscr();

  for (a=0;a<256;a++)
  {
      if ((a%13==0)&(a>1)) printw("\n");
      printw("%3d=",a);
      if ((a<10) || (a>13))
          {
          // mask the character with const A_ALTCHARSET
          addch(a+A_ALTCHARSET);}   
      else
          { printw(" ");}
      addch(ACS_VLINE);
  }

  getch();
  endwin();
  return;
}

Good Luck
Javicho ;)


All times are GMT -5. The time now is 08:19 AM.