问题
How to setup a correct codepage in groff
?
For example to use a cyrillic language.
Man page notes about -T
switch. But troff -T utf8 -ms troff_file.txt
gives:
warning: invalid input character code 128`
回答1:
-Tutf8
only selects the output device. If you want groff
to accept Unicode input, use the -K switch.
Another way to have Cyrillic is simply to use Tlatin1
to enable eight-bit character codes, and feed groff
a source file in a single-byte encoding such as CP 1251
or KOI8-R
. Don't forget to prepare your hyphenation file accordingly.
来源:https://stackoverflow.com/questions/23138930/text-codepage-in-groff