When I create a file with UTF-8 encoding in Java, and I open it in Notepad or Notepad++ afterwards it says it is ANSI encoded. How come?
File file = new File("path\to\file");
file.createNewFile();
Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8));
writer.write("something");
writer.flush();
writer.close();
If I write some special characters like Æ. Ø or Å to the file, then notepad says it is UTF-8 encoded. Why is this?
Is ANSI and UTF-8 byte representation the same if no special characters is included?