[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Querying terminal's ability to do unicode
From: |
Thomas Dickey |
Subject: |
Re: Querying terminal's ability to do unicode |
Date: |
Wed, 27 Dec 2017 21:19:12 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Dec 27, 2017 at 04:12:37PM +0000, Mike Gran wrote:
> Hi.
>
> So I'm writing an application to which a client will connect by telnet.
> It links ncursesw, and formw.
>
> On connection, the application asks the user
> "Enter terminal (or just hit return for xterm-256color)"
>
> Once I get this terminal string from the user, how do I query the
> terminfo to see if this user can get Unicode, or just G0/G1 Latin1,
> or just ASCII?
>
> There are some related properties: smacs, rmacs, set1_desc_seq,
> but I don't know how to unpack that to answer my question.
The information isn't in the terminal database. There's no portable
method for determining the encoding that the terminal supports.
Try this - with the caveat that the actual values are system-dependent,
just like the locale environment variables:
result = nl_langinfo(CODESET);
http://pubs.opengroup.org/onlinepubs/9699919799/functions/nl_langinfo.html
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature