tags 466396 fixed-upstream
thanks

On Mon, Feb 18, 2008 at 02:36:18PM +0000, Colin Watson wrote:
> On Sun, Feb 17, 2008 at 11:58:54PM +0100, Robert Luberda wrote:
> > Colin Watson writes:
> > >2.5.1-1). Viewers that use groff, troff, or nroff to format manual pages
> > >should instead use 'man -Tutf8' (which also removes the need to call
> > >tbl, eqn, et al explicitly), instruct the display code to expect UTF-8,
> > >and depend on man-db.
> > 
> > I tried to add support for recoding manpages into UTF-8 into dwww. 
> > However `man -Tutf8' doesn't  work correctly - the manual page is 
> > recoded  to ISO-8859-1 first and then passed to groff -Tutf8:
> > 
> >  [54]/tmp> man -d -Tutf-8  -L pl dpkg   2>&1 > /dev/null  | grep 
> > 'Starting.*manconv'
[...]
> > Is there any other way to get properly encoded UTF-8 man pages?
> > I know that `LC_ALL=some_locale.UTF8 man -L pl dpkg' would work, but 
> > this requires valid UTF-8 locale, and dwww can't assume that any such 
> > locale is available. `man --recode' also doesn't seem to be useful in 
> > this case.
> 
> The problem here is that the only facility offered to control the output
> encoding other than by way of the locale is to select a different groff
> device. Unfortunately groff's utf8 device really does expect ISO-8859-1
> input; in order to deal with ISO-8859-2 we have to use the ascii8 device
> and then use iconv to recode the output to UTF-8 if necessary.
> 
> This is clearly a bug. I think the best answer here would be to add an
> --output-encoding option to man which would override the locale
> encoding; I'll get right on that next time I have time to work on
> man-db.

As of man-db 2.5.2, you'll be able to use the '-E UTF-8' option to force
the output encoding. ('man -E' exists in 2.5.1, but I've extended its
semantics.)

Sun Mar  2 11:03:21 GMT 2008  Colin Watson  <[EMAIL PROTECTED]>

        Improve 'man -E' to allow overriding the output encoding explicitly,
        rather than implicitly (and unreliably) by changing the *roff device
        (Debian bug #466396).

        * src/encodings.c (device_table): Add stub entries for troff
          devices.
          (is_roff_device): New function.
        * src/encodings.h (is_roff_device): Add prototype.
        * src/man.c (options): Change description of -E to allow general
          encoding selection.
          (parse_opt): Only assign the argument of -E to roff_device if it
          is actually a *roff device; otherwise it is presumed to be a true
          character encoding and stored in want_encoding. Remove
          different_encoding, since testing whether want_encoding is set
          supersedes that.
          (make_roff_command): If want_encoding is set and is not a *roff
          device, recode to it rather than to the locale's encoding.
          (display, try_section, display_filesystem, display_database): Test
          want_encoding rather than different_encoding.
        * man/man1/man.man1 (OPTIONS): Adjust documentation of -E.
        * docs/NEWS: Document this.

        * src/lexgrog_test.c (options): Bring description of -E into sync
          with man.

Cheers,

-- 
Colin Watson                                       [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to