Created
February 18, 2014 13:35
-
-
Save greenrobot/9071091 to your computer and use it in GitHub Desktop.
Bash script to convert Java sources to UTF-8 recursively
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/sh | |
# For Windows: http://gnuwin32.sourceforge.net/packages/libiconv.htm | |
PATH=$PATH:/c/Program\ Files\ \(x86\)/GnuWin32/bin/ | |
for file in $(find -name "*.java") | |
do | |
echo $file | |
iconv -f ISO-8859-1 -t UTF-8 "$file" >"${file%}.tmp" | |
mv "$file.tmp" "$file" | |
# dos2unix doesn't seem to work here!? IntelliJ did better here. | |
dos2unix "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment