groff
[Top][All Lists]
Advanced

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

Re: [Groff] man problem: Latin1 characters in nion-Latin1 locale


From: Tomohiro KUBOTA
Subject: Re: [Groff] man problem: Latin1 characters in nion-Latin1 locale
Date: Mon, 20 Nov 2000 23:11:34 +0900
User-agent: Wanderlust/1.1.1 (Purple Rain) EMY/1.13.8 (Tastes differ) FLIM/1.13.2 (Kasanui) APEL/10.2 Emacs/20.7 (i386-debian-linux-gnu) MULE/4.1 (AOI)

Hi,

At Mon, 20 Nov 2000 11:28:09 +0000,
Stewart C. Russell <address@hidden> wrote:

> > However, I think the idea of 'troffrc' is not nice.
> 
> This is the main problem with lout; it can have user-specified
> initialisation.
> Bleah!

I cannot understand your point.

The problem is how to determine the encoding of roff source and
tty output.

I thought Andrej proposed to use troffrc.  A user who want to use
KOI8-R encoding can write something in troffrc file.  A user who
want to use EUC-JP encoding can write something in troffrc file.

However, in such a method, a user would have to edit foorc, barrc,
and so on so on besides troffrc, since the user uses softwares of
foo, bar, and so on so on besides troff.  This is troublesome.
Instead, all softwares should work properly with setting LANG
variable.  This is the point I wrote in the last mail.

Thus, I insist _no_ configuration should be needed specially for Groff
to select proper encoding.

Or, do you say you have a good idea to achieve this by writing
something in troffrc file in the Groff distribution archive,
without using C functions such as setlocale() and so on?
I cannot imagine it.


Andrej wrote:
> Is it possible to access current locale in troffrc? Given possible variety of
> locale names, something like locale alias table looks reasonable. I may try to
> implement something like this.

No need for such a table.  Even, no need for accessing the current
locale in troffrc.  The following code will give the encoding.

   setlocale(LC_CTYPE, "");
   char * encoding = nl_langinfo(CODESET);

The value can be used for open_iconv() to convert into UTF-8 in the
preprocessor.

Ok, we have to wait for UTF-8-enabled troff and pre/postprocessor.

Note that Groff is often used to format manpages. Since manpages are
supplied by the vendor, encoding of the manpages is independent on
the current locale.  For example, the following situations are very
likely:
 - read Russian KOI8-R manpages in Russian UTF-8 locale
 - read English ASCII manpages in Russian KOI8-R locale
Thus my preprocessor will have a method that the manpages can have 
information on their own encodings.  This will override the encoding 
decided by current locale.

---
Tomohiro KUBOTA <address@hidden>
http://surfchem0.riken.go.jp/~kubota/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]