Writing UTF-8 without BOM
问题 This code, OutputStream out = new FileOutputStream(new File("C:/file/test.txt")); out.write("A".getBytes()); And this, OutputStream out = new FileOutputStream(new File("C:/file/test.txt")); out.write("A".getBytes(StandardCharsets.UTF_8)); produce the same result(in my opinion), which is UTF-8 without BOM. However, Notepad++ is not showing any information about encoding . I'm expecting notepad++ to show here as Encode in UTF-8 without BOM , but no encoding is being selected in the "Encoding"