groff
[Top][All Lists]
Advanced

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

Re: [Groff] man file character encoding.


From: Werner LEMBERG
Subject: Re: [Groff] man file character encoding.
Date: Thu, 26 Sep 2013 06:50:38 +0200 (CEST)

Hello Erwin!


Please send such questions to the groff mailing list (which I've now
CCed).

> It is now three years later, and I'm still having trouble with the
> coding tag (see below).  Do you remember?

Mhmm, vaguely :-)

> This was my problem:
> 
> I set a French locale fr_FR.UTF-8, and have a Latin-1 formatted man
> page (vim.1).  The problem was that the coding tag was lost
> somewhere, and the French text was not displayed properly.
>
> My /etc/man.conf file has this line:
>
> NROFF /usr/bin/preconv \
>       | /usr/bin/nroff -c -mandoc \
>       2> /dev/null
>
> The man page has these line at the top:
> 
> .\" -*- coding: latin1; -*-
> .\" Traduction Lundi 7 août 2000 par Richard Hitier
> .\" (address@hidden)
> .\" Mise à jour de la traduction par David Blanchet
> 
> The Latin1 characters are shown as squares when I show the man page.
> When I add the option -Dlatin1 to preconv, the page is shown
> properly.  So why is the coding tag not picked up?
>
> Today I changed my NROFF line in /etc/man.conf to this, to see the
> input of preconv.
>
> NROFF tee /tmp/out.txt \
>       | /usr/bin/preconv \
>       | /usr/bin/nroff -Tutf8 -c -mandoc \
>       2> /dev/null
>
> When I open /tmp/out.txt I see these top lines:
>
> .if !\n(.g .ab GNU tbl requires GNU troff.
> .if !dTS .ds TS
> .if !dTE .ds TE
> .lf 1 -
> .pl 1100i
> .\" -*- coding: latin1; -*-
> .\" Traduction Lundi 7 août 2000 par Richard Hitier
> .\" (address@hidden)
> .\" Mise à jour de la traduction par David Blanchet
>
> There are 5 new lines at the top. The coding tag has shifted to
> line 6.  I think this explains why the coding tag is not working,
> because the coding tag has to be on the first or second line.

Yes.

> Why are there lines added to vim.1?

It seems that the `tbl' preprocessor is run too early.  Looking into
the `man' manpage (man-db version 2.6.3) and searching for `tbl', I
see this:

   -p string, --preprocessor=string

      Specify the sequence of preprocessors to run before nroff or
      troff/groff.  Not all installations will have a full set of
      preprocessors.  Some of the preprocessors and the letters used
      to designate them are: eqn (e), grap (g), pic (p), tbl (t),
      vgrind (v), refer (r).  This option overrides the $MANROFFSEQ
      environment variable.  zsoelim is always run as the very first
      preprocessor.

Can you check that?

> How can this be fixed?

Assuming that the problem is caused by `-p', a possible solution is to
not use this man option or environment variable and add option `-t' to
nroff in `/etc/man.conf'.


    Werner

reply via email to

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