So I wrote a Java program that writes a text file using the FileWriter class. In the write() there are some "\n". When I run the class file in my computer (W10) it works as intendend and the text is separated by line breaks. However, if I run the class in my friends computer (also W10), the text file is created without any line breaks, all in a single line, and no spaces between lines. However, if he runs a version of the program where all the "\n" are replaced with "\r\n", it works as intended. The CMD of my friend's computer is using chcp 932 while mine is 850, if that helps.
That makes me wonder... even if it works for me just with "\n", should I use the "\r\n" form to ensure compatibility?
Thanks!