having the same problem while using FileWriter. When opening the file with notepad there are squares added into the file, but with (for example) wordpad they are gone. Anyone have any idea where they come from? The text is taken from a JTextArea. The display there is also OK.
I notice the same thing when opening some .java files, depending on how the files were created (for example, in JBuilder or some other IDE). I think it comes from Notepad being a very simple text editor. Wordpad is slightly "smarter", so it knows how to handle special characters and formatting better.