Fix smart quotes with sed

# use :help digraph and ^K in Insert Mode
# convert smart double quotes to straight double quotes
s:�~@[~\|~]]:":g;
# fix smart apostrophe  
s:�~@[~Y]:':g;  

And run with:

sed -f fix-unicode.sed < input.txt > output.txt

This file will exist in the bgscripts repo at some point. I’m sure copy-pasting this script from this article will not work.

References

Original work

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.