ascii-tyrant.sh: handle e2 80 98, use sed with g
authorColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Mon, 28 Jan 2013 23:37:07 +0000 (15:37 -0800)
committerColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Mon, 28 Jan 2013 23:37:07 +0000 (15:37 -0800)
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 <cmccabe@alumni.cmu.edu>

ascii-tyrant.sh

index 62eee66..1c01966 100755 (executable)
@@ -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 -