I have this line of code in java:
new BufferedWriter(new OutputStreamWriter(new FileOutputStream(name, append), "UTF-8"));
This writer does not write an UTF-8 file, because when I open it in notepad++ it says that the encoding is: ANSI as UTF-8. I need it to be pure UTF-8.
Do you have any suggestions?
notepad++ (and any other tool) can only guess the encoding, it’s not written anywhere in your file (or in some metadata).
And if the text you’ve written doesn’t contain any characters outside the ASCII range (i.e. no character with a Unicode codepoint > 127), then a file with ANSI encoding is indistinguishable from one in UTF-8 encoding.