I have a problem.
The file may be written in a character set, such as UTF-8, UTF-16, UTF-32etc.
When I read the file UTF-16, I use the following code:
BufferedReader in = new BufferedReader(
new InputStreamReader(
new FileInputStream(file), "UTF16"));
How to determine which encoding is in the file before I read the file?
When I read the UTF-8encoded file with UTF-16, I cannot read the characters correctly.
source
share