RE: Character encoding of a file
Yes, just check the first coupel of bytes. For example, the first two bytes of a TFF-16 Unicode file will be 0xFF 0xFE. You can find all the specs you want for all the encoding kinds on the internet.
One thing though: if the file you try to open was simply recorded in an old multibyte format, then there's no header and you cannot know for sure without testing the file visually (I do that with IE myself as it lets you switch the encoding quickly).
|