Posted in Command Line, Linux Change File Encoding Binny V A February 17, 2008 2 Comments on Change File Encoding Creates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding. iconv -f fromEncoding -t toEncoding inputFile > outputFile Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.
don’t set the input and the output file as the same or you’ll end up with an empty file like me. use a temporary file and then override the old one 😛 Reply
@aza : better: use `sponge` tool (it acts like a buffer) : iconv -f fromEncoding -t toEncoding myfile | sponge myfile Reply
don’t set the input and the output file as the same or you’ll end up with an empty file like me. use a temporary file and then override the old one 😛
@aza : better: use `sponge` tool (it acts like a buffer) :
iconv -f fromEncoding -t toEncoding myfile | sponge myfile