"A" written using UTF-8 without a BOM produces exactly the same file as "A" written using ASCII or ISO-8859-* or any other ASCII-compatible encodings. That file contains a single byte with the decimal value 65.
Think of it this way:
"A".getBytes("UTF-8")
returns anew byte[] { 65 }
"A".getBytes("ISO-8859-1")
returns anew byte[] { 65 }
- You write the results of those calls into a file
- How is the consumer of the file supposed to distinguish the two?
There's nothing in that file that suggests that UTF-8 needs to be used to decode it.
Try writing "Käsekuchen" or something else that's not encodable in ASCII and see if Notepad++ guesses the encoding correctly (because that's exactly what it does: it makes an educated guess, there's no metadata that tells it which encoding to use).