Post Closed as "duplicate" by Gilles, techraf, Anthon, HalosGhost, GAD3R of
3 edited tags; edited tags
| link
2 added 141 characters in body; edited title
source | link

How do I process text before I hand it over to enscript? (Or how do I print UTF8 Mutt messages to PDF?)

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.

How do I process text before I hand it over to enscript?

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?

How do I process text before I hand it over to enscript? (Or how do I print UTF8 Mutt messages to PDF?)

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.

1
source | link

How do I process text before I hand it over to enscript?

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?