I am writing a some text into file using the FileWriter object. I am specifying that I want the output to be in UTF-8,but when i open the text file and go to save as , I see that it is in ANSI encoding.
I want to also add that when there are characters other than the standard ascii charset (eg:- japansese character) the file encoding is UTF-8, but without then text file encoding is ANSI.
File json_file= new File(path);
FileWriter json_file_output=newFileWriter(json_file,StandardCharsets.UTF_8);
json_file_output.write("SOME JSON TEXT HERE");
json_file_output.flush();
I am not sure whether it is due to java code or notepad.
Thank you for the help.