Batchconvert ascii to utf8

May 12, 2009 by Michael

Next time i see umlauts in source, I’ll scream. Loud.

In the mean time I try this:

find . -iname "*.java" -exec sh -c 'iconv -f cp1252 -t utf-8 {} > {}.utf8' \;
for i in `(find . -name "*.utf8")`; do mv $i ${i/.utf8/}; done

Before you try this, make a backup of your files. It worked for me but i don’t guaranty that your files won’t vanish.

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *