Skip to content

Instantly share code, notes, and snippets.

@mdjnewman
Created February 15, 2015 07:57
Show Gist options
  • Save mdjnewman/801c5cabfc0477b4596d to your computer and use it in GitHub Desktop.
Save mdjnewman/801c5cabfc0477b4596d to your computer and use it in GitHub Desktop.
Simple script to fix encodings from files created with the 'WordPress to Jekyll Exporter' tool
#!/bin/bash
FILES=$(find . -name \*.md)
for i in $FILES; do gsed -i "s/–/–/g" $i; done
for i in $FILES; do gsed -i "s/\xC2\xA0/ /g" $i; done
for i in $FILES; do gsed -i 's/>/>/g' $i; done
for i in $FILES; do gsed -i "s/…/…/g" $i; done
for i in $FILES; do gsed -i "s/“/“/g" $i; done
for i in $FILES; do gsed -i "s/”/”/g" $i; done
for i in $FILES; do gsed -i "s/‘/‘/g" $i; done
for i in $FILES; do gsed -i "s/’/’/g" $i; done
for i in $FILES; do gsed -i "s/(/(/g" $i; done
for i in $FILES; do gsed -i "s/)/)/g" $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment