473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Line graphics on Linux console

Hi all

I don't think this is strictly a Python problem, but as it manifests
itself in one of my Python programs, I am hoping that somebody in this
group can help me.

The following is a message I sent to co.os.linux.setup -

"My question concerns line graphics on a text-based console. *My
actual problem relates to a [Python] program I have written using
ncurses, b*ut you can easily test it by running a program like
minicom.

If you call up the minicom menu, it should be surrounded by *a nice
box made up of horizontal and vertical lines, corners, etc. It used to
work up until Redhat 7. Since upgrading to Redhat 9, and now Fedo*ra,
it (and my program) has stopped working."

I received the following reply from Thomas Dickey -

"That's because Redhat uses UTF-8 locales, and the Linux cons*ole
ignores vt100 line-drawing when it is set for UTF-8. (screen also
d*oes this).
ncurses checks for $TERM containing "linux" or "screen" (sin*ce
there's no better clues for the breakage) when the encoding is UTF-8*,
and doesn't try to use those escapes (so you would get +'s and -'s).
co*mpiling/linking with libncursesw would get the lines back for a
properly-wri*tten program."

I don't really understand the last sentence. Does anyone know if it is
possible to do this (or anything else) or am I stuck.
TIA for any advice.

Frank Millman

Jul 18 '05 #1
1 3740

Frank Millman wrote:
Hi all

The following is a message I sent to co.os.linux.setup -

"My question concerns line graphics on a text-based console. *My
actual problem relates to a [Python] program I have written using
ncurses, b*ut you can easily test it by running a program like
minicom.

If you call up the minicom menu, it should be surrounded by *a nice
box made up of horizontal and vertical lines, corners, etc. It used to work up until Redhat 7. Since upgrading to Redhat 9, and now Fedo*ra, it (and my program) has stopped working."

I received the following reply from Thomas Dickey -

"That's because Redhat uses UTF-8 locales, and the Linux cons*ole
ignores vt100 line-drawing when it is set for UTF-8. (screen also
d*oes this)."


For the record, I have found a solution, or at least a workaround.

I received the following suggestion from Steve (thanks Steve) -

"As a quick check to see if it's only the UTF-8 locales that are
affecting your program, try invoking your program, like so:

$ LANG=C <your-proggy>"

I tried this, but it did not work. However, it felt as if it ought to,
so I sent another message to Thomas Dickey (who, I have discovered, is
the maintainer of the ncurses library).

He replied that the console is probably still in unicode mode, but you
can turn it off with 'unicode_stop'.

I tried this and it worked :-) - I did not even have to change the LANG
or TERM settings.

Obviously this will not work if you need unicode, but luckily for me I
do not, so it is a perfect workaround.

Frank Millman

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JBiagio | last post by:
Hello All, I am attempting to learn a bit about the GDI+ transforms and charting data and I feel like I'm getting a handle on how the transforms work. My chart object has a large "canvas" bitmap...
5
by: sank | last post by:
Hello all, I want to display graphics file (BMP/JPEG/GIF) on the console in c++... help...
0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
6
by: sudip | last post by:
Dear C programmers, Can I do graphics programming on Linux platform, like I do on MS-DOS platform using the graphics.lib library and bgi drivers... if yes, then how?.. plz help. thanx in advance.
1
by: Paul Hoad | last post by:
I'm trying to use MeasureString() to determine the length in pixels of a string However to do I need a System.Drawing.Graphics object to do this I need to create a System.Drawing.Graphics...
6
by: Fredmanglis | last post by:
I've been teaching myself the C++ Programming language. So far however, I have not come across any useful tutorials on how I can output coloured text, create drawings or graphics in C++. All I can...
14
by: marko | last post by:
Hi everyone, I'm an artist and I'm looking for a way to draw a line that will zig-zag its way thru an image randomly, crisscrossing itself many times, based on random numbers. To give you an...
11
by: rossum | last post by:
I want to declare a const multi-line string inside a method, and I am having some problems using Environment.NewLine. I started out with: class foo { public void PrintStuff() { const...
5
by: Firecore | last post by:
Hello there. This a part of a program i am trying to make. I am trying to learn how to use graphics in a console C++ App. I am using the Visual C++ 6 and whenever I try to run this code, I can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.