A Screen Replacement

Author: (Norbert) Suedland, Aalen, Germany

In the face of a yet not completely finished list of all Unicode charaters for the screen output, there is a welcome replacement: the protocol file.

In C, the input via a keyboard or the output onto the screen are carried out as read and write operations of corresponding files. Therefore, here can alternatively be written also into a file, where today's Unicode font has been clearly expanded in comparison with Windows 95.

Already under Windows XP, there are at least three different Unicode codings:

Therefore, the first programming example now is deviating from Kernighan and Ritchie [1988KR] a programme, which does not generate screen output, but file output only. Here, a programme is suitable, which lists the predefined switches for the compiler.

Programme protocols in English are called log file, analogously to the log book of shipping, and end with .log. Such protocols are also possible, if the user of a programme carries out many things by use of the mouse. The protocol file in comparison with keyboard and screen is not opened automatically at the begin of a programme, but first must be opened and then be written. Windows is organized in such a way, that keyboard and screen have been opened for C programmes in text mode and therefore depending on the Windows version cannot process Unicode characters, if the programme avoids Windows functions:

Since there is the possibility, that the protocol file exists and is protected by write protection, the programmer must check, whether the generating of his protocol file has been successful. At programme end all open files are closed automatically, too. However there is gain to close also the protocol file explicitly at the end.

Now, this procedure is going to be shown

  1. first with 7 bit ASCII,
  2. then with 8 bit ASCII,
  3. and finally with 16 bit Unicode.

References (next constribution) Table of Contents A Historical Problem (previous contribution)
Deutsche Fassung Esperanta versio