View Single Post
Old 01-20-2005, 05:44 AM   #3 (permalink)
Hosiah
Registered User
 
Join Date: Jun 2004
Location: Des Moines, Iowa
Posts: 4
Hosiah is on a distinguished road
The distro is Red Hat 9.0.

The ncurses library distro is version 5.3 as I stated in my post.

The compiler I'm using is gcc as stated in my post.

sample code would be things like:

printw("%c", 3); //does NOT print a heart
addch(ACS_ULCORNER); //does NOT print an upper left corner
add_wch(anything); //does NOT print the corresponding charcater for
//any value of *anything

Like you could infer from my post.

What happens is just plain keyboard characters are substituted instead.

I've since found out that there is rumor of a bug involving UTF-8 (what I'm using in my setup) and compiled C programs in Linux(in general, not just my distro). I did even get the following source code:


#include <stdio.h>
#include <string.h>
main ()
{/* compile with GCC: gcc <thisfile.c> -o <output executable file> */
int i;
printf("Use \\016 to switch to \"upper\" mode and use \\017 to\n");
printf("switch back to \"normal\" mode. \\xxx is an octal number \n");
printf("in printf. The dec values are 14 and 15.\n\n");
printf("Dec. CHAR HEX Dec. CHAR HEX\n");
i=96;while (i < 126){
printf("%i, %c = \016%c\017 (0x%X) ",i,i,i);
i++;
printf("%i, %c = \016%c\017 (0x%X)\n",i,i,i);
i++;}}
/* END OF C PROGRAM */


That I found online to compile and run from xterm (on the desktop), and it correctly displayed the characters. The same code run from the console prompt didn't.

Hope this clears it up, but I don't know if I'll ever solve this one. I would at least like a pointer into more info on that bug/or how to work around it.

There's also a trade-off point. Even if I could get the extra doohickeys to work on my machine, it would be stupid of me to use them in any programs I intend releasing, if it would mean to expect the user to go to this site, download this file, install this RPM with that option, and the rest of the etcetera rat dance to get my program to work. Else, I can just draw in bad keyboard graphics and explain the whole fiasco of why the text graphics suck in a README.

Or go on to VGA/OpenGL, which is what I'm on now. Of course, the whole reason to use ncurses is to ensure that you program is portable to run on anything from a System V to a bagel toaster, without the need for fancy graphics.

But if it's just a simple switch to flip in some obscure configure file, I could go ahead and use it.

Comprendo, hermano?
Hosiah is offline   Reply With Quote