[Top][All Lists]

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

Re: [Groff] Re: man page encoding

From: Bruno Haible
Subject: Re: [Groff] Re: man page encoding
Date: Thu, 7 Jul 2005 21:40:34 +0200
User-agent: KMail/1.5

Andries Brouwer wrote:
> If there is a pipeline, then earlier
> stages in the pipeline already need the character set.
> So, conversion may have to be done before the input reaches groff.

Yes, and that's why groff is designed as a set of filters. If you need
one of the filters early on, just call it yourself. The second call, by
groff, will then be a nop.

Btw, if a program in the pipeline, before groff, actually needs the
character set, it will be able to infer it from the "coding:" marker.
Whereas in the past, without a marker, it cannot know whether it's processing
something in KOI8-R or ISO-8859-5.

> And that also brings up a different point. If I have a file
> that has topline -*- coding: EUC-JP -*- and I feed it to
> a program like iconv, must that program change the topline?

The "gpreconv" filter must be idempotent:
         gpreconv | gpreconv  ==  gpreconv.
Whether it achieves this by converting the input to UTF-8 and changing the
marker to "coding: utf-8", or whether it converts the input to ASCII with
lots of \[...] or \N[...] escape sequences and leaves the marker in place,
is an unimportant detail.


reply via email to

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