LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 05-16-2005, 01:01 PM   #1
bwysocki
LQ Newbie
 
Registered: May 2005
Distribution: SuSE
Posts: 9

Rep: Reputation: 0
extended ascii in kde


I'm in the process of porting a SCO Unix C program over to SuSE Linux. It is a text based program which I am currently executing in a bash shell through the KDE Konsole program. (on SCO it runs from the ksh command line).

The program is written in C which I compiled with gcc.

The program uses extended ASCII characters to draw line graphics (ie. ASCII decimal value 179 draws a vertical line).

This works fine on DOS and SCO. But on Linux the line graphics get translated into box characters. Our quick fix is to change the characters to standard ASCII (ie. using a pipe (|) symbol for a vertical line). This gives us line graphics in our program, but looks like garbage.

I also wrote out a little program to output the ascii table, and it looks like every character from 128 and above is not defined.

I've read that ncurses could be used for this purpose. Would ncurses give me the characters I need both in KDE and from a non KDE (console) login.

And yeah.. In case you haven't guessed already, I'm a linux newbie. I've got a couple weeks worth of SuSE under my belt.

Thanks,
Bob
 
Old 05-16-2005, 01:09 PM   #2
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
The problem comes from the font that displays your chars, for example if the
char 179 is not built in the font, there is no chance that you could display it.

Also the encoding is important, from man iso_8859-1 :
Code:
Oct   Dec   Hex   Char   Description
--------------------------------------------------------------------
263   179   B3          SUPERSCRIPT THREE
As you can see, if you use iso_8859-1 encoding, the char with dec value 179
will print a ' '
 
Old 05-16-2005, 03:56 PM   #3
bwysocki
LQ Newbie
 
Registered: May 2005
Distribution: SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
I see in the iso 8859-1 man page what you mention (the character being Subscript three). Given that, is there an encoding that has any of the old "extended ascii" (for lack of a better term) line characters?

Using a console login, and running my little program that outputs the ascii table, All charactes 128 and above appear blank.

I haven't played with the character set any on this linux implemtation. Should I be changing a setting to get the right character set?

Thanks

Last edited by bwysocki; 05-16-2005 at 04:00 PM.
 
Old 05-18-2005, 01:19 PM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
try setting LC_CTYPE to iso_8859_1; that should iso-enable your console.

for emacs, add
Code:
(set-variable 'mm-body-charset-encoding-alist '((iso-8859-1 . 8bit)))
(set-variable 'default-input-method "latin-1-postfix")
to ~/.emacs

My recommendation would be to not rely on the dos extensions, and use iso-8859-1 (or plain ascii) with curses instead -- curses is ported to dos.

hth --Jonas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
extended ascii codes in c++ crAckZ Programming 1 09-12-2005 05:04 PM
Extended ASCII set. exvor Programming 1 12-19-2004 03:44 PM
using extended ASCII at the console <keyboard> buhbuh Linux - Newbie 0 06-29-2004 07:09 PM
extended ascii in RH9 deleeuw Linux - Hardware 2 07-28-2003 11:08 AM
extended ascii in RH9 deleeuw Linux - General 0 07-18-2003 12:33 PM


All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration