How to find the file encoding and updating the file encoding?

Hi,
I am beginner to Unix.
My requirement is to validate the encoding used in the incoming file(csv,txt).If it is encoded with UTF-8 format,then the file should remain as such otherwise i need to chnage the encoding to UTF-8.
Please advice me how to proceed on this.

Hi,
Any suggestion for the above question.

You have not said what platform you are on. There are different utilities on different platforms which can help you. For example, Solaris has the auto_ef (Auto Encoding Finder) utility which does what you are want. On GNU/Linux the file utility provides this information.

I need it for AIX platform.

On AIX you probably want to be using iconv

iconv -f IBM-930 -t UTF-8 infile > newfile

I doubt you can automate the detection of the encoding used on files it it's not specified somehow in the files themselves. Try playing around with AIX file -i and see what it thinks of your input files.

can some one tell how to do same think in hp-ux

I think iconv is available on hp-ux too.

i am talking about the auto_ef utility.
is there any thing similar to this in hp-ux