From 7c80bd8c80220222b240e2fa2daaa8e4a57a5f53 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Mon, 15 Feb 2010 14:19:31 -0800 Subject: [PATCH] Add ascii-tyrant.sh ascii-tyrant.sh strips non-ascii characters from text files. --- ascii-tyrant.sh | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) create mode 100755 ascii-tyrant.sh diff --git a/ascii-tyrant.sh b/ascii-tyrant.sh new file mode 100755 index 0000000..828e944 --- /dev/null +++ b/ascii-tyrant.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# 1. translate curly single quotes into regular single quotes +# 2. translate other kind of curly single quotes into regular single quotes +# 3. translate em-dashes into '--' +# 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/"/' | \ +cat - + -- 1.6.6.rc1.39.g9a42