groff
[Top][All Lists]
Advanced

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

Re: [Groff] man file character encoding.


From: Erwin Waterlander
Subject: Re: [Groff] man file character encoding.
Date: Thu, 26 Sep 2013 21:33:23 +0200
User-agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

Werner LEMBERG schreef, Op 26-9-2013 6:50:
>
> Hello Erwin!

Hi,

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


Thanks.

>
>> 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?

The same text is in the man page of man 1.6g.
I have no other man variables set than MANPATH.
$ env |grep -i man
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man

When I use the -p option to disable all the preprocessors, the man page is still displayed incorrectly.
I can see that the coding tag is now on the second line.

$ man -p "" vim

$ head /tmp/out.txt
.pl 1100i
.\" -*- coding: latin1; -*-
.\" Traduction Lundi 7 ao▒t 2000 par Richard Hitier
.\" (address@hidden)
.\" Mise ▒ jour de la traduction par David Blanchet
.\" (address@hidden) 2006-06-10
.\" Mise ▒ jour de la traduction par Dominique Pell▒
.\" (address@hidden) 2008-11-29
.\"
.TH VIM 1 "22 F▒vrier 2002"


export MANROFFSEQ=""
has the same effect.

>> 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'.

I was not using the -p option originally.
nroff is run after preconv. I don't see how the -t option helps.

My conclusion is that the coding tag in the man page is not working, even when you disable all preprocessors and the coding tag gets to the second line. Disabling all preprocessors is probably not what you want. The only way out, with the use of Federico's man and preconv, is to convert all man pages to UTF-8.
But there also appears to be man-db... See my next mail.

best regards,

--
Erwin Waterlander
http://waterlan.home.xs4all.nl/



reply via email to

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