Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Systems > Linux / BSD / OS X

Reply
 
LinkBack Thread Tools Display Modes
Old 01-19-2005, 01:23 AM   #1 (permalink)
Hosiah
Registered User
 
Join Date: Jun 2004
Location: Des Moines, Iowa
Posts: 4
Hosiah is on a distinguished road
ncurses won't display anything but keyboard characters!

I'm just about pulling out my hair with this problem, now. I love curses programming in Linux, and have managed to create several nifty little applications in it. But I still can't get:

The extended ASCII-character set (like heart/diamond/spade/club)
The ncurses border-drawing characters (with the ACS calls to addch)
Any wide-character support at all (Unicode and etc.)

Now, I've downloaded the ncurses library v. 5.3 and even have the man pages on my system for add_wch() and similar functions. But gcc errors on attempt to compile these commands, and I can't find any of them in the header file!

I know what you're all thinking, "His hardware/configuration can't handle wide characters". Nope! Not it! I know it CAN, because when I type "cat /dev/random " at the prompt, I get every character in the universe printed on my terminal (and the occasional beep).

So, how or why or what or where? Anybody know how to do this?
Hosiah is offline   Reply With Quote
Old 01-19-2005, 07:02 PM   #2 (permalink)
ender
Code Monkey
 
ender's Avatar
 
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
ender is on a distinguished road
Send a message via AIM to ender Send a message via Yahoo to ender
Could you provide some sample code? Distro? Compiler?

Thanks,
Ted
__________________
while(1) fork();
ender is offline   Reply With Quote
Old 01-20-2005, 06: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
Old 02-01-2005, 07:36 PM   #4 (permalink)
Hosiah
Registered User
 
Join Date: Jun 2004
Location: Des Moines, Iowa
Posts: 4
Hosiah is on a distinguished road
An update:

The problem I've described turns out to be Bug Report #143014, right here . In case anybody else searches for this information and stumbles on yet another unanswered question mimicking their own...
Hosiah is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control table display with php & Postgresql? tomycon PHP 2 07-17-2002 08:16 AM


All times are GMT -8. The time now is 12:51 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting