From cbcac7311450e58fe9b7b0d80833f70d1b4844f7 Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Mon, 28 Jan 2013 15:37:07 -0800 Subject: [PATCH] ascii-tyrant.sh: handle e2 80 98, use sed with g handle 0xe2 0x80 0x98, which seems to appear in place of space when cutting-and-pasting from certain PDFs. Use sed 's/../.../g' so that all instances of the bad pattern are replaced. Signed-off-by: Colin McCabe --- ascii-tyrant.sh | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ascii-tyrant.sh b/ascii-tyrant.sh index 62eee66..1c01966 100755 --- a/ascii-tyrant.sh +++ b/ascii-tyrant.sh @@ -6,10 +6,11 @@ # 4. translate curly start double quotes into regular double quotes # 5. translate curly end double quotes into regular double quotes cat | \ -sed "s/\xe2\x80\x98/'/" | \ -sed "s/\xe2\x80\x99/'/" | \ -sed "s/\xe2\x80\x93/--/" | \ -sed 's/\xe2\x80\x9c/"/' | \ -sed 's/\xe2\x80\x9d/"/' | \ +sed "s/\xe2\x80\xa9/ /g" | \ +sed "s/\xe2\x80\x98/'/g" | \ +sed "s/\xe2\x80\x99/'/g" | \ +sed "s/\xe2\x80\x93/--/g" | \ +sed 's/\xe2\x80\x9c/"/g' | \ +sed 's/\xe2\x80\x9d/"/g' | \ cat - -- 1.6.6.rc1.39.g9a42