R
rihad
Hi, I have this problem: when reading a M$ Windows text file under Windows in
text mode (fopen("blah", "r")) the Windows newline sequence, \r\n is returned as
is, i.e. it's not replaced by a single '\n'. Is this the correct behaviour? But
doesn't it make writing portable programs a bit harder? It would be nice if
whatever-newline-sequence-the-platform-has were replaced by a single \n, i.e.
the "C platform" line terminator. Like ints are always 64 bit in Java
irregardless of what platform lies under the Java platform.
In case it is indeed like that, how is my program supposed to know which line
terminator is being used?
text mode (fopen("blah", "r")) the Windows newline sequence, \r\n is returned as
is, i.e. it's not replaced by a single '\n'. Is this the correct behaviour? But
doesn't it make writing portable programs a bit harder? It would be nice if
whatever-newline-sequence-the-platform-has were replaced by a single \n, i.e.
the "C platform" line terminator. Like ints are always 64 bit in Java
irregardless of what platform lies under the Java platform.
In case it is indeed like that, how is my program supposed to know which line
terminator is being used?