This behavior is observed on Windows platforms when you read a file in text mode using the 'rt' option in FOPEN. The following applies on Windows systems, in text mode:
- Read operations that encounter a carriage return followed by a newline character ('\r\n' or 0D 0A in Hex) remove the carriage return from the input.
- Write operations insert a carriage return before any newline character in the output.
Please refer to the documentation of FOPEN function for more information: