I\'m facing a problem.
A file can be written in some encoding such as UTF-8, UTF-16, UTF-32, etc.
UTF-8
UTF-16
UTF-32
When I read a UTF-
UTF-
You can read the first few bytes and try to guess the encoding.
If all else fails, try reading with different encodings until one works (no exception when decoding and it 'looks' OK).