3 ms·
If "text" means binary data where the numbers represent characters according to some mapping (code page), then there can be binary files containing no text, bin
by ptx 4y ago
If "text" means binary data where the numbers represent characters according to some mapping (code page), then there can be binary files containing no text, binary files containing among other things some text or binary files consisting entirely of text.
For example, a file of raw audio samples doesn't contain any text. (You could interpret it as text in some code page if (unlike e.g. ISO 8859-1) all bytes are valid in that code page, but you'd end up with nonsense.)
An SQLite file definitely contains text, but also other things, so it's not "plain text". If "text file" means a file consisting entirely of text, and nothing else, it's not a text file.
- A4ET8a8uTh0 4y agoThank you for your explanation. Admittedly, I was not thinking of plain text. I was thinking of the first option with the wrong interpretation of the word binary, which made me automatically jump to conclusion that binaries are basically 1s and 0s[1] and clearly it is not that simple. Thank you everyone. It feels like today I re-learned something I misunderstood a long time ago. https://apple.stackexchange.com/questions/364789/why-isnt-a-binary-file-shown-as-0s-and-1s https://apple.stackexchange.com/questions/364789/why-isnt-a-...
- Tijdreiziger 4y ago> which made me automatically jump to conclusion that binaries are basically 1s and 0s[1] and clearly it is not that simple. It essentially _is_ that simple, it’s just how you interpret those 1s and 0s. Say you try to interpret a PNG file as text: you get some representation of the 1s and 0s in that file, just not the right one.