Line graphics on Linux console

Discussion in 'Python' started by frank@chagford.com, Jan 29, 2005.

  1. Guest

    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
    , Jan 29, 2005
    #1
    1. Advertising

  2. 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
    Frank Millman, Feb 1, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robotnik

    Console Graphics

    Robotnik, May 10, 2004, in forum: Java
    Replies:
    7
    Views:
    6,990
    void_void
    Dec 16, 2009
  2. Edward
    Replies:
    0
    Views:
    435
    Edward
    Aug 10, 2003
  3. smartbeginner
    Replies:
    7
    Views:
    412
  4. Replies:
    4
    Views:
    618
  5. Replies:
    1
    Views:
    591
Loading...

Share This Page