Version 2 (modified by alexander@…, 16 years ago) ( diff )

Use a better solution for the sort syntax problem


The optional "LPRng or CUPS" build-time dependency is not mentioned in the book. Without the "lpr" program, A2PS will think that the proper way to send files to printers is "cat JOB > PRINTER".

The script from i18n-fonts uses obsolete syntax for the "sort" program and thus fails with Coreutils-5.93. Modify this script before installation in order to avoid this problem:

sed -i 's/+0 -1/-k 1,2/'

The encoding of the input text can be specified using the -X parameter. To get the list of available input encodings, type:

a2ps --list=encodings

Problem 1: UTF-8 is not in the list. This makes A2PS unusable for printing UTF-8 encoded text files. One workaround is to convert the text file from UTF-8 to some supported encoding that still contains all needed characters (koi8-r in the example below), as illustrated below:

iconv -f UTF-8 -t koi8-r utf8-encoded-file.txt | \
    LC_ALL=C a2ps -o -X koi8-r

The LC_ALL=C environment variable is needed because if the document encoding and the locale encoding are incompatible, a2ps misprints the date and the "Page 1/1" header. LC_TIME=C LC_MESSAGES=C are the minimum subset of locale categories to override.

The workaround above does not work if there is no supported 8-bit encoding that contains all needed characters.

Using PAPS instead of A2PS for printing UTF-8 encoded text files is a better solution.

Problem 2: ISO-8859-7 is listed as supported but actually does not work (produces "M-a" instead of the greek letter "alpha", and so on). A solution is described at Another option is to use a different program (e.g. PAPS) for printing.


Note: See TracWiki for help on using the wiki.