6

I cannot figure out how to handle accents with enscript when converting a txt into a pdf:

echo "élisée" | enscript  -o - -X <encoding> | ps2pdf - output.pdf

I tried all possible encoding but none are leading to the proper result.

I guess I should add a iconv at the first stdout


List of enscript encoding that I have tried:

  • 88592
  • 88593
  • 88594
  • 88595
  • 88597
  • 88599
  • 885910
  • ascii
  • asciifise
  • asciidkno
  • ibmpc
  • mac
  • vms
  • hp8
  • koi8
  • ps
  • pslatin1
AlexP
  • 10,217
  • 32
  • 41
user123456
  • 4,758
  • 11
  • 52
  • 78

1 Answers1

11

The usual character encoding in Linux is UTF-8; however, enscript does not support UTF-8. You need to convert the text to an encoding supported by enscript, such as ISO 8859-1:

echo "élisée" | iconv -f utf-8 -t iso-8859-1 | enscript -X 88591 -o - | ps2pdf - output.pdf

Or you could use a text-to-PostScript converter which accepts UTF-8 encoded text, such as paps.

j1088099.mvrht.com.
  • 2,903
  • 3
  • 13
  • 20
AlexP
  • 10,217
  • 32
  • 41