开发者

Re-encoding entire code base from UTF-16 to UTF-8

开发者 https://www.devze.com 2023-02-09 20:29 出处:网络
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)

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
0

精彩评论

暂无评论...
验证码 换一张
取 消