# 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 A
A philosopher programmer who specializes in backend development and stoicism.

## 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. h__k says:

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