Possible Duplicate:
How can I convert multiple files to UTF-8 encoding using *nix command line tools?

Okay, now that I can detect the encoding, I know that my encoding is using charset=iso-8859-1 instead of utf. How can I convert this?

iconv -f iso-8859-1 -t utf-8 < file > file.new
  • 5
    @Arjan: Because I wanted to post a straightforward answer, without hiding it in for loops and "bash magic"? – user1686 Jun 13 '10 at 12:32
  • Ok, that might make sense indeed (though such straightforward answers are found in the other questions too). No need for the < by the way. – Arjan Jun 13 '10 at 12:44
  • 7
    @Arjan Note that Google points to this answer first.. – tomdemuyt Jun 18 '11 at 19:18
  • I did this.. now that file was completly emptied....... and I don't have any backup of it.. great.......... – OZZIE Nov 3 '18 at 14:33
  • 1
    @OZZIE then I am afraid you did it wrong – Matt Sephton Feb 11 '19 at 1:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.