Recently, we have translated Chinese MAN manuals and found that MAN commands in MAC systems cannot display Chinese MAN manuals as well as in most Linux distributions.
Based on the searched information, the solution is found:
1. Update the groff package in your system. The groff package in MAC (10.8 and 10.9) is 1.18, which is a few years old. You need to upgrade it, you can download the latest groff 1.22 compilation or install it through port.
2. You need to modify MAN's configuration file:
Sudo vi/private/etc/man. conf
Modify the NROFF configuration:
NROFF preconv-e utf8 |/opt/local/bin/groff-Wall-mtty-char-Tutf8-mandoc-c
In this way, the MAN page encoded by UTF8 can be identified by groff through transcoding.
Modify PAGER configuration:
PAGER/usr/bin/less-isR
In this way, the ANSI Escape Character Sequence on the MAN manual page can be avoided (used to control the formats such as bold)
Save it.
By the way, let's talk about how to display MAN in color.
Add the following to the environment variable:
Export GROFF_NO_SGR = 1
Export LESS_TERMCAP_mb = $ '\ E [01; 36m'
Export LESS_TERMCAP_md = $ '\ E [01; 36m'
Export LESS_TERMCAP_me = $ '\ E [0m'
Export LESS_TERMCAP_se = $ '\ E [0m'
Export LESS_TERMCAP_so = $ '\ E [01; 44; 33m'
Export LESS_TERMCAP_ue = $ '\ E [0m'
Export LESS_TERMCAP_us = $ '\ E [01; 33m'
In this way, MAN is the color. If you want to adjust the color, you can modify the above Escape Code accordingly.
However, a side effect of this method is that it will disturb the display of command output such as env.
Therefore, a better solution is to use the env command to redefine the man command environment:
Man (){
Env GROFF_NO_SGR = 1 \
LESS_TERMCAP_mb = $ '\ E [1; 36m '\
LESS_TERMCAP_md = $ '\ E [1; 36m '\
LESS_TERMCAP_me = $ '\ E [0m '\
LESS_TERMCAP_se = $ '\ E [0m '\
LESS_TERMCAP_so = $ '\ E [1; 44; 33m '\
LESS_TERMCAP_ue = $ '\ E [0m '\
LESS_TERMCAP_us = $ '\ E [1; 33m '\
Man "$ @"
}
The above can be put in your/etc/bashrc.
Recommended reading:
IOS 7 Beta 2 released, supporting iPad and iPad Mini
IOS7 Beta 1 Test
IOS 7 beta [Download + tutorial + experience] for iPhone 5, 4S, 4, iPod touch 5
How to activate iOS 7 beta
Apple releases an official version update for iOS 7