Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to get a proper display of national characters with FreeBSD man. I have tried running the following on 8.1 and 9.0:

# PAGER=less LANG="pl_PL.UTF-8" man -d -M. ./man.1
-- Using architecture: i386:i386
-- Using pager: less
-- Using manual sections: 1:1aout:8:2:3:n:4:5:6:7:9:l
-- Using locale paths: pl_PL.UTF-8:pl.UTF-8:en.UTF-8:.
-- Using standard page width
-- Searching for ./man.1
-- Found a usable page, displaying that
-- Command: /usr/bin/zcat -f ./man.1 | tbl | groff -S -P-h -Wall -mtty-char -man -Tascii -P-c | less

But it prints:

Program man jest systemowA przeglAdarkA stron podrAcznika ekranowego.KaA1/4dy argument...

The same manpage displays properly on a Linux host:

Program man jest systemową przeglądarką stron podręcznika ekranowego. Każdy argument...

I have been told by a knowledgeable person that manpages on 9.0 are supposed to display properly. What am I missing?

share|improve this question

2 Answers 2

I think you are missing having LESSCHARSET=utf-8 in your environment. At least on my FreeBSD host using this setting allows me to view the manual pages in the right way.

share|improve this answer

The -Tascii argument to groff looks suspicious.

On further investigation, it seems man sets this parameter based on where in the MANPATH it found the man page.

For example, on my system, -Tutf8 is used whenever the debug output shows

Found manpage /usr/share/man/en.UTF-8/man1/...

but -Tascii is used when it shows

Found manpage /usr/share/man/man1/...

In this case, I think the problem is that man doesn't see any locale name in the path to the man page, so it defaults to ASCII/C locale.

As a workaround, try this:

mkdir -p pl.UTF-8/man1
cp man.1 pl.UTF-8/man
man -d -M. man
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.