Hi I am writing some data into a text file. This data uses System . getProperty("line.separator") to get a new line. On some machines, instead of getting a new line I'm getting those weird boxes. Does this problem occur on Unix machines or culd the problem be something else?
The line separator is there; the problem is with the program you're using to view the text: Windows Notepad. Every other program in the world will accept any of the three most common line separators: "\n" (linefeed only), "\r" (carriage-return only), or "\r\n" (carriage-return + linefeed). But Notepad only recognizes "\r\n", the traditional line separator for DOS/Windows systems. Just use something other than Notepad to view the text, and don't worry about the line separators.