I need to use the command “file -i” to identify the file encoding and then convert to another encoding, such as ascii to utf-8.
My plan is to file -i >> logfile
Next is to check logfile for the encoding type and if ascii, convert to utf-8
there should only be the single line from the file -i
So depending on the encoding type, execute the iconv to convert from one to the other encoding. can this be done using scripting?