I saw on Undeadly a note that OpenBSD's Ted was patching the ancient bcd program, which converts text into ASCII-art representations of punch cards. Punch cards were a technology from the 1960s and 1970s (?) that stored code or data on cardstock, with holes punched out of them. Each card held a line of text. If I recall correctly, each character was a column on the card, with as many as seven holes punched out of set of 12 possible locations. There were 40 to 80 columns on the card, according to the brand and the decade.
Anyway, Ted modified the bcd program to read in the ASCII-art representation of punch cards that it generated, so that it became, essentially, a very inefficient reversible encoding, but, he was unsure where to search for documents that he could use to validate the output.
My goto place for tech docs from the 1970s is archive.org. If you've never searched its collection, you should check it out.
Anyway, I did manage to find a couple of references there to punch card encoding.
For a couple of brands, anyway, punch card encoding seemed to have, for each character, a 4-bit "zone" or category and an 8-bit index. But this didn't result in a 12-bit encoding. Only a sparse subset of the available 12-bits indicated a character, for mechanical reasons, I guess. A subset of the characters now included in ASCII were encodable, but, missing some punctuation such as square brackets. It is for reasons like this that the C standard has trigraphs.