Aw: Why do binary files contain text but text files don't contain binary?

From: Jörg Knappen <unicode_at_unicode.org>
Date: Fri, 21 Feb 2020 20:02:18 +0100
 
From a practical point of view, text files contain text that is broken into lines. And by a long-standing tradition,
line breaks are treated differently among different operating systems. Whenever one transfers a text file between
operating systems, the process behing that transfer cares to convert the line breaks according to the target OS's conventions.
 
Binary files are much simpler: They can be just transfered without converting anything, even between different operating systems.
 
Of course, this does not mean that an executable under one OS remains being a valid exe under another OS, but there lots of non-executable
binaries that are useful independent of the OS (e.g. images, sound files, video files, lots of other application files).
 
So, for a successful file transfer one needs to know whether it is text or binary, and handle it accordingly.
 
--Jörg Knappen
 
Gesendet: Freitag, 21. Februar 2020 um 13:21 Uhr
Von: "Costello, Roger L. via Unicode" <unicode@unicode.org>
An: "unicode@unicode.org" <unicode@unicode.org>
Betreff: Why do binary files contain text but text files don't contain binary?

Hi Folks,

 

There are binary files and there are text files.

 

Binary files often contain portions that are text. For example, the start of Windows executable files is the text MZ.

 

To the best of my knowledge, text files never contain binary, i.e., bytes that cannot be interpreted as characters. (Of course, text files may contain a text-encoding of binary, such as base64-encoded text.)

 

Why the asymmetry?

 

/Roger

Received on Fri Feb 21 2020 - 13:02:45 CST

This archive was generated by hypermail 2.2.0 : Fri Feb 21 2020 - 13:02:45 CST