When saving data, you have the choice between binary and text formats. For example, if the integer 1234 is saved in binary, it is written as the sequence of bytes
00 00 04 D2 (in hexadecimal notation). In text format, it is saved as the string
"1234". Although binary I/O is fast and efficient, it is not easily readable by humans. We first discuss text I/O and cover binary I/O in Section 1.3, “Reading and Writing Binary Data,” on p. 25.
When saving text strings, you need to consider the character encoding. In the UTF-16 encoding, the string
"1234" is encoded as
00 31 00 32 00 33 00 34 (in hex). However, many programs expect that text files are encoded in a different encoding. In ISO 8859-1, the encoding most commonly ...