8

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

1 Answer 1

14

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.

1
  • 2
    Using iso-8859-1//TRANSLIT instead of plain iso-8859-1 may save you some iconv: illegal input sequence at position XX errors. Commented Jun 19, 2018 at 14:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.