[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#327147: konsole: ncurses application are badly displayed

On Thu, Sep 08, 2005 at 11:40:18PM +0200, Vedran FuraÄ? wrote:
> Thomas Dickey wrote:
> > On Thu, Sep 08, 2005 at 11:20:10AM +0200, Vedran Fura?? wrote:
> >
> >>Thomas Dickey wrote:
> >>
> >>>The bug is in iptraf - it's not using setlocale().
> >>
> >>Are you sure? Because it's not only iptraf. Same thing is with
> >>centericq, links, hexcurse, bastet,...and every this app is displayed
> >>nice in gnome-terminal, xterm, etc.
> >
> >
> > I'm certain, having just looked at this last week.  You'll find the same issue
> > with Linux console:  when in UTF-8 mode, the terminal no longer responds to
> Yes, the same thing is in the linux console. What do you mean under
> "UTF-8 mode", locale settings or something else? I have tried different
> locale settings but that didn't help.

When Linux console is initialized to handle UTF-8 output, it behaves with
iptraf just as your picture of konsole.  The console code ignores the
vt100-style line-drawing described in its terminfo.  So applications running
in the console when it's in that mode must use the UTF-8 encoding for the
look-alike Unicode values that are in the font loaded for the console.

Changing your locale settings won't change the mode of the console - that's
done by sending an escape sequence to it.  Also, resetting the terminal
makes it go back to vt100-mode.  Altogether, not a very good design, but
it's out there in millions of computers.

Since iptraf doesn't pay any attention to the locale settings (and doesn't
initialize its locale), ncurses can only assume that it's either a POSIX
locale or the legacy (for configurations _without_ locale support), 8-bit

> > The application must take this into account.  For ncurses, that's done by
> > setting up the locale support within the calling application.
> So, there is no quick solution for this, no workarounds? I'll just have
> to wait? Am I the only one experiencing this problem?

The quick workaround for iptraf is to add
	#include <locale.h>
	setlocale(LC_ALL, "");

(I tested that for iptraf last week when I was replying to a different
report on this issue).

Thomas E. Dickey

Attachment: pgpL2zU5oGO2n.pgp
Description: PGP signature

Reply to: