Bug 208966 - [patch] man(groff) not supporting (pl_PL.)UTF-8 input
Summary: [patch] man(groff) not supporting (pl_PL.)UTF-8 input
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.3-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: easy, patch
Depends on:
Blocks:
 
Reported: 2016-04-21 22:44 UTC by Maciej Trynkowski
Modified: 2017-01-07 21:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Trynkowski 2016-04-21 22:44:01 UTC
`Man` uses `groff`, which is accepting only ascii as input - for example UTF-8 characters are not displayed correctly. Current version of `groff` is 1.19.2, which doesn't support -k, -K and -D flags. Those flags are supported by `groff` version 1.22.3 located in ports. Flags mentioned use `preconv` to escape characters from the outside of ascii. `Preconv` is already present in the FreeBSD.

How-To-Repeat:
1. create man page inside localized man directory MANPATH/pl.UTF-8/man1/manproblem.1.gz with polish letters (ęóąśłżźćń)
2. Properly setup locale, fonts, keyboardmapping, etc.
export LANG=pl_PL.UTF-8
3. Show man page:
man manproblem

Proposed solutions:

1. Use newer version of `groff` and update `man` script (-D flag says to use `preconv` as preprocessor to `groff` as well as specifies input encoding - this was already proposed option in linked bug issue):

333c333
<               NROFF="$NROFF -D$nroff_dev -T$nroff_dev"
---
>               NROFF="$NROFF -T$nroff_dev"

2. Use `preconv` as preprocessor and update `man` script (doesn't require to use port version of `groff`):

333c333
<               NROFF="$NROFF -T$nroff_dev"
---
>               NROFF="$PRECONV -D$nroff_dev | $NROFF -T$nroff_dev"

941a942
> PRECONV=preconv
Comment 1 Michael Osipov 2016-09-04 20:02:42 UTC
Suffering for the same problem with the Midnight Commander port. Russian man page is competely broken.
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2017-01-07 21:06:56 UTC
On FreeBSD 11+ man uses mandoc which properly support unicode and thus does not have the problem any more.

For 10.3 such changes cannot be merged.