17 Feb

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


## 2 thoughts on “Change File Encoding”

1. 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 😛

2. @aza : better: use sponge tool (it acts like a buffer) :
iconv -f fromEncoding -t toEncoding myfile | sponge myfile