Does anyone have a good way 开发者_JAVA百科to re-encode all the *.java file in a directory from UTF-16 to UTF-8?
Run this in your favorite POSIX compatible shell (while you're in the source directory):
find -name "*.java" | while read f; do
mv "$f" "$f.bak"
iconv -f utf-16 -t utf-8 < "$f.bak" > "$f"
done
精彩评论