2

I stumbled upon bad special characters in some manpages:

If your terminal is a "true" auto-margin terminal (it doesn▒<80><99>t allow the last position on the screen to be updated without scrolling the screen) consider using a version of your terminal▒<80><99>s termcap that has automatic margins turned off. This will ensure an accurate and optimal update of the screen in all circumstances. Most terminals nowadays have "magic" margins (automatic margins plus usable last column). This is the VT100 style type and perfectly suited for screen. If all you▒<80><99>ve got is a [...]

I have done some research. man uses $pager as its display tool and this is set to less in my environment. So apparently less is not able to display the man pages's special characters.

My terminal (putty) is set to Utf-8, and $LANG=en_US.UTF-8. What can be wrong?

d135-1r43
  • 411
  • 4
  • 13

3 Answers3

3

See first if you have LESSCHARSET environment variable set.

echo $LESSCHARSET

If that is not utf-8 already, then set it:

export LESSCHARSET="utf-8"

See if that helps. You may also try a pager called most, it's available at least on Debian/Ubuntu package repositories.

Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
0

Try another pager (such as most).

PAGER=most man command_name

or

man -P most command_name

or

man --pager=most command_name

to see whether it can display the apostrophes correctly.

It may be that the source file (if any) for the man page is bad, the tools for processing the man page (*roff) are handling the character incorrectly, or the object file (cat file) those tools create may be incorrect. On some systems, you can regenerate the man page object files.

Run man with one of these options (-W, --where-cat or --location-cat) to see where the cat file is located. Try renaming (rather than deleting - so you can put it back if necessary) the cat file so a new one gets generated.

You might try specifying the encoding to see if it helps. Try UTF-8 and UTF-16, for example.

man -E UTF-8 command_name

or

man --encoding=UTF-8 command_name

Finally, run mandb to check the cache consistency.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
0

Try -r option to display raw characters, example:

less -r file.txt