Answer the question
In order to leave comments, you need to log in
How to determine file encoding format?
(More precisely, not even just Unicode, but "updated the title of the question")...
The task is as follows. When reading a file, you need to determine its encoding, for example, ANSI, UTF-8, UTF-8-BOM, and 3 other things. So far, only such thoughts come to mind (correct if I'm wrong).
Take at least the first line of the file, split it into 8 bits, and check further on this basis.
1) But how?
So far, I have made an array of bytes from the receiving file into a function byte[] bFile = new byte[(int) file.length()];
that I display on the screen through
System.out.println(Integer.toBinaryString(b & 255 | 256).substring(1));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question