How do I process text before I hand it over to enscript? (Or how do I print UTF8 Mutt messages to PDF?)
2
votes
1
answer
715
views
I'm trying to use
enscript
to print PDFs from Mutt, and hitting character encoding issues with curly quotes. So that an email with text like this:
“very dirty”
we’re
Comes out as:
â\200\234very dirtyâ\200\235
weâ\200\231re
My print script currently reads like this:
#!/usr/bin/env sh
INPUT="$1" PDIR="$HOME/Desktop" OPEN_PDF=evince
tmpfile="mktemp $PDIR/mutt_XXXXXXXX.pdf
"
enscript --font=Courier8 $INPUT -2r --word-wrap --fancy-header=mutt -p - 2>/dev/null | ps2pdf - $tmpfile
$OPEN_PDF $tmpfile >/dev/null 2>&1 &
sleep 1
rm $tmpfile
Is there a way to replace the curly quotes before I send it to enscript
? Or a character encoding I can use that will handle the quotes?
If there's another (better?) way to print to PDF from Mutt, I'm all ears. I just need to ensure that my quotes aren't getting fouled up.
Asked by Amanda
(1818 rep)
Nov 20, 2016, 02:55 AM
Last activity: Nov 20, 2016, 01:35 PM
Last activity: Nov 20, 2016, 01:35 PM