In our application I have to open a text file which will be sum time UTF-8 format or UTF-16 format .

Is there any way to determine the file format of a file? Or Is it possible to check the readied 'NSString' is valid ?