ISO/IEC 646 and my Olivetti Printer 
5.9.16, 10:30 - retro & C64
Last year or so I got the chance to reanimate an old Olivetti Typewriter ET compact 60 with a parallel printer interface. The most difficult part was to get it printing german Umlaute (öäü). I wrote a small script with linux "sed" command replacing the ö character with others that would fit on my Typewriter to print an ö
(example: sending an '|' results in a printed 'ö')
the linux command goes like
sed 's/ö/|/g'

I never found any instuctions on how to use this typewriter correct or which set of characters are replaced by others, and even the internet is unaware.

After changing the printer driver lately the character replacementscript did not work anymore as expected, so I had to re-Do it and dig a bit deeper to find out what is going on:
the characters for äöü have decimal values of 123, 124 and 125...
So I decided to find the corresponding codepage used.
Its: ISO/IEC 646-DE, a 7 bit coded character set used from the 60s to the end 80s (and btw. true german ASCII).
The detailed name is ISO 646-021 National Standard DIN 66003 (Code page 1011, 20106)

Is anybody out there who knows how to get windows printing to 7bit ISO 646-DE printers?

My solution is to simply to replace the characters (as shown here) and print the replaced text.

You can save the folowing script under cygwin and run it like "./ input.txt output.txt"
sed 's/|/</g;s/ü/}/g;s/ö/|/g;s/ä/{/g;s/Ä/[/g;s/Ö/\\/g;s/Ü/]/g;s/ß/~/g;s/«/"/g;s/»/"/g;s/$/\r/'  $1 >$2

Why does this work, even though the txt file is saved in utf-8?
The first 128 of the 2,164,864 characters in utf-8 are plain ASCII (sadly not the german version 😄 ).


Kommentar hinzufügen