I believe “\r\n” is a normal newline for windows “type” files.
Yes, but inside a ruby program it’s just “\n”–no matter what OS you
are running your ruby program on. ruby will take care of
converting from and to the platform specific newline when you read or
write. For instance, if you are using windows and write “\r\n” to a
file, then ruby will convert the “\n” to “\r\n” giving you the output:
“\r\r\n”, which is not what you want.
JRuby may have some gotcha because these semantics work on many
languages (C, Perl, Python, …) but not in Java.
In C printf("\n") is portable, stdio takes care of the translation on
Windows, but in Java \n has no translation. In Java the portable way to
print a newline is println.
I am pretty sure they addressed this years ago though and JRuby provides
MRI semantics to the user. Which is the code that is not working?