when writing / reading a file in text mode, the new line character is converted to carriage return and line feed ie \ n to \ r \ n, but this does not happen in binary mode.
Similarly, ASCII 26 will be written at the end of the file in text mode, but this does not happen in binary mode.
I know that this question was asked earlier in SO, but there I did not find any arguments in favor of this behavior.
I mean, this behavior is just for differentiating between text and binary mode, or there is some specific reason for this translation, and not a record of the ASCII value 26 in the case of binary mode.
source share