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
<
and >
are intentional – they redirect input from file
and output into file.new
. The input redirection is optional since iconv could read its input directly, but I wanted it to be present for consistency.
Jul 1, 2022 at 7:50
file.new
MUST NOT BE the same as file
, otherwise the result will indeed be an empty file
Sep 18, 2023 at 13:49