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?
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?
Use iconv:
iconv -f iso-8859-1 -t utf-8 < file > file.new
<by the way. – Arjan Jun 13 '10 at 12:44<file>(no spaces) as in "substitute your filename here", or; are you redirecting the output with>and the preceding<is an error? There is a suggested edit (as well as the first comment) which suggests removing the<. I guess this is due to the spaces aroundfileinside the<...>making it look confusing and as if the<is a typo. What increases the confusion is that the secondfile.newdoes not have<...>. You might want to fix that. I'd suggest thaticonv -f iso-8859-1 -t utf-8 <filename> <filename>.newis better... at least it's consistant – Greenonline Jul 01 '22 at 06:46<and>are intentional – they redirect input fromfileand output intofile.new. The input redirection is optional since iconv could read its input directly, but I wanted it to be present for consistency. – u1686_grawity Jul 01 '22 at 07:50file.newMUST NOT BE the same asfile, otherwise the result will indeed be an empty file – René Roth Sep 18 '23 at 13:49