Re: Encoding in nroff and man

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

 



Yevgeniy Makarov wrote:
Hello,

I am using FC7, and I discovered an apparent inconsistency in handling
encodings by nroff and man. If there is another place where I should
address this question, I would appreciate if you let me know.

I noticed the issue of encoding in man because I am using Midnight
Commander which is apparently only able to use 8-bit encodings for
output. As a result, I had some garbage where single quotation marks
should have been when I viewed man pages in MC (using M-! key). The
reason was that these single quotation marks were Unicode characters
taking more than one byte.

Looking at /etc/man.config, I saw that man uses

/usr/bin/nroff -c -mandoc 2>/dev/null

command to process man files. Since the man page for nroff says that
it accepts the option -T<encoding>, I thought I would add the option
"-Tlatin1", but it did not make any difference. Looking inside nroff,
which is a shell script, it seems that it ignores the -T option:

case $1 in
    ...
    -[eq] | -s* | -u* | -T* )
      # ignore these options
      ;;

Further, there seems to be only one place where the nroff script
determines the value of charset_out variable, and that is from the
"locale charmap" command, even though nroff man page says that it also
tries  LC_ALL, LC_CTYPE,  LANG, and LESSCHARSET environment variables.

When I replaced the nroff command with groff, the -Tlatin1 option
worked and I was able to obtain the man page in latin1 encoding.

Of course, I can set LC_ALL to en_US.iso88591, but I may want to have
Unicode in Xterm when I am not running MC, and, secondly, this does
not eliminate the mismatch between the nroff man page and the actual
behavior of nroff.

I would appreciate any thoughts on this.

Evgeny

It sounds to me the title is wrong. I read man and info in a terminal. Using Midnight Commander is not my way. In anycase the title should be that MC can't display man pages.

	You have done a lot of work getting MC to work.


--

	Karl F. Larsen, AKA K5DI
	Linux User
	#450462   http://counter.li.org.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux