Converting “De Re Intellivision” to UTF-8

Posted on March 6, 2019
Tags: other

The jzIntv emulator source distribution comes with some documentation about the Intellivision, including a series of documents called De Re Intellivision.

De Re Intellivision is difficult to read, because it has a weird character set encoding, and looks like this:

CP-1600 Register set ³
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

 8 bits 8 bits
ÚÄÄÄÄÄÄ¿ÄÄÄÄÄÄ¿

ÚÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ R0 ÄÄÄ No assigned function.
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R1 Ä¿
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R2  ÃÄ Data Counters
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R3  ³
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R4 ÄÂÄ Data Counters
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R5 ÄÙ  with autoincrement
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R6 ÄÄÄ Stack
ÃÄÄÄÄÄÄÅÄÄÄÄÄÄ´ R7 ÄÄÄ Program Counter
ÀÄÄÄÄÄÄÁÄÄÄÄÄÄÙ

ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
    16 bits

However, it is easy to convert to UTF-8. The following should work on most UNIX variants, including Mac OS X and Linux:

cd jzintv-20181225-src/doc/De_Re_Intellivision
iconv -f cp437 -t utf-8 dri_1.txt > dri_1-utf8.txt
iconv -f cp437 -t utf-8 dri_2.txt > dri_2-utf8.txt
iconv -f cp437 -t utf-8 dri_6.txt > dri_6-utf8.txt
iconv -f cp437 -t utf-8 dri_9.txt > dri_9-utf8.txt

Now it will look like this:

CP-1600 Register set

Update: The above isn’t quite good enough, because it still leaves some ^P, ^Q, and ^_ in the diagrams. So, an even better command is:

iconv -f cp437 -t utf-8 dri_2.txt | tr '\020\021\036\037' '><^v' > dri_2-utf8.txt

Update 2: That still leaves some ^V in dri_6.txt. So, the final version of the command is:

iconv -f cp437 -t utf-8 dri_6.txt | tr '\020\021\036\037\026' '><^v-' > dri_6-utf8.txt