Batch convert files to utf-8

find . -name "*.php" -exec iconv -f ISO-8859-1 -t UTF-8 {} -o ../newdir_utf8/{} \;

By: afinzel
2009-02-12 13:07:54

What Others Think

I'm shocked Finzel, you mean to tell me they weren't in UTF-8 format to start with! You haven't been using that other OS again have you?
xiris · 675 weeks and 3 days ago
Have a look at fslint which will report which are not in UTF8 and allow you to selectively convert them:
pixelbeat · 675 weeks and 3 days ago
Eep I didn't actually add that to the GUI. The detection script is here:
pixelbeat · 675 weeks and 3 days ago
sorry. i?m new one in linux command. But this command get the same result with the same name. no ?!
FabianHutch · 310 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: