Skip to content

Instantly share code, notes, and snippets.

@ennorehling
Created December 17, 2018 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ennorehling/c6637e7c06cbb1e73e27720537169f1a to your computer and use it in GitHub Desktop.
Save ennorehling/c6637e7c06cbb1e73e27720537169f1a to your computer and use it in GitHub Desktop.
Source encoding fixer
#!/bin/sh
while [ ! -z $1 ] ; do
tmpfile=$(mktemp eressea.XXX)
iconv -f latin1 -t utf-8 < $1 | \
perl -pe 's/ß/ss/; s/ä/ae/; s/ü/ue/; s/ö/oe/;' \
> $tmpfile && \mv $tmpfile $1
shift 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment