Moving Unicode text between Windows and Linux/MacOS

If a text file or Java file has Unicode characters like ¥ or £ and you move it between operating systems, you are likely to encounter a parser error in Linux / MacOS cribbing about invalid character in UTF-8 file.   This can be fixed by using iconv on Linux / MacOS as simple as below.


for i in `find src -name *.java`; do tmp=mktemp; iconv -f windows-1252 -t utf-8 $i > $tmp; mv $tmp $i; done