Last active
May 6, 2019 15:54
-
-
Save Mebus/b04f7a4d365527d2ee2879300621b90b to your computer and use it in GitHub Desktop.
Convert Matlab scripts from ISO-8859-1 to UTF-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script converts Matlab scripts from ISO-8859-1 to utf-8 (a modern standard) | |
# requirements: bash, iconv | |
# | |
# @author Mebus, https://mebus.github.io | |
# | |
for f in $(find . -iname "*.m" -exec file -i {} \; | grep "iso-8859-1" | grep -Eo '^.*\.m') | |
do | |
echo $f | |
iconv -f iso8859-1 -t utf-8 $f > $f.utf8 | |
mv $f.utf8 $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment