Force Windows NewLinw

Hi,

I've a problem with new line character. I am in Windows platform but

when I write a file with a BufferedWitter with println I obtain the

character "\n" x0D like separator (Unix Separator). My System property

line.separator is "\r\n".

Can someone tell me how can I obtain files with the correct \r\n

Windows new line character?.

Thanks in advance.

[400 byte] By [fealfua] at [2007-10-2 17:46:53]
# 1

Try something like this:

final String NEW_LINE = System.getProperty("line.separator");

FileWriter writer = new FileWriter("test.txt");

BufferedWriter buffer = new BufferedWriter(writer);

buffer.write("1");

buffer.write(NEW_LINE);

buffer.write("2");

buffer.write(NEW_LINE);

buffer.write("3");

buffer.write(NEW_LINE);

buffer.close();

prometheuzza at 2007-7-13 19:04:48 > top of Java-index,Desktop,I18N...
# 2
ResolvedThe problem was another process that automatically was replacing "\r\n" form "\n" and I don磘 know it.All works fine.Thanks a lot.
fealfua at 2007-7-13 19:04:48 > top of Java-index,Desktop,I18N...