Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Feb 1998 23:40:05 -0800
From:      Jonathan Mini <j_mini@efn.org>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        j_mini@efn.org, hackers@FreeBSD.ORG, questions@FreeBSD.ORG
Subject:   Re: character-set information for terminals.
Message-ID:  <19980204234005.30868@micron.mini.net>
In-Reply-To: <199802050732.AAA10666@usr08.primenet.com>; from Terry Lambert on Thu, Feb 05, 1998 at 07:32:34AM %2B0000
References:  <19980204231234.44363@micron.mini.net> <199802050732.AAA10666@usr08.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert <tlambert@primenet.com> stands accused of saying:
> > > > Also from "man setlocale"... 8-).
> > > 
> > >   BAH! I missed the reference to a man page. Please hand me a tiny pointy
> > > hat. 
> > 
> >   Only problem is that the locale doesn't provide me with the information I
> > need. :(
> 
> What exactly do you need?

  I needed to know the font (i.e. iso 8859-l1, cp 437, etc, etc) that the
user's terminal was running. Looks like the _CLOSEST_ I can get without
asking the user is to grab the line drawing and a few other symbols from
the termcap. *sigh* This leaves much to be desired, since a lot isn't in
the termcap, such as character accents and other similar things. 

  The locale does not give me that information. All it tells me is the
formatting of various standardized things such as tiem time, date, and
currency. 

  I guess you misunderstood my original question : I need to know how to
find out what font (or "character set") the user has on their terminal.
Looks like there isn't really any way of auto-detecting that.

> All terminal devices are expected to run in the C locale, unless
> otherwise specified by the user -- just as all terminal devices
> are expected to behave as dumb tty's, unless otherwise specified
> by the user.
> 
> In either case, the user does their specifying with environment
> variables.
> 
> One might wish for an explicit locale specification mechanism in
> /etc/ttys, just as terminal types may be specified there.
> 
> NOTE: Your use of the TERM environment variable to "know" the
> terminal type of the device and therefore which termcap entry to
> use is limited to the fact that there is an explicit mapping of
> device to line; the rest of your environment comes in via an
> environment passing mechanism, for pty devices accessed by other
> programs.
> 
> Unfortunately, there is no explicit locale mechanism in /etc/ttys;
> and even though there is *exactly* the same static mapping of the
> /etc/gettytab entries as there is TERM envirnment variable values,
> there is also no explicit locale mechanism in /etc/gettytab.
> 
> Of course, there's a non-explicit locale mechanism in /etc/gettytab:
> set the environment variables using the "ev" property...
> 
> Then you might want to set a vt220 initialization string the the vt220
> termcap to place it in an NRCS mode (or download sixels for your
> chosen international character set), by overloading "im"...
> 
> But then if you did all that, you might as well set the terminal type
> using the "tt" property, instead of putting it in /etc/ttys.
> 
> And if all else fails, run a program other than /usr/bin/login to
> get everything set up (using the "lo" property...
> 
> man ttys
> man gettytab
> 
> 8-).
> 
> 
> 					Terry Lambert
> 					terry@lambert.org
> ---
> Any opinions in this posting are my own and not those of my present
> or previous employers.

-- 
Jonathan Mini
(j_mini@efn.org)

 "A child of five could understand this! Quick -- Fetch me a child of five."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980204234005.30868>