class BBS::Gateway::AsciiBridge

The translation a gateway puts on the line when a PETSCII caller (a Commodore 64) dials a board made for ASCII and ANSI terminals. The board’s bytes go down as PETSCII: text in UTF-8, or CP437 from the first bytes that are not UTF-8 on, through a Petscii::Encoder, so letters swap case, ANSI colours and cursor moves become C64 control codes and line drawing the nearest glyph. The C64’s keys go up as an ANSI terminal sends them.

bridge = BBS::Gateway::AsciiBridge.new
bridge.down("Hello\r\n")   # PETSCII bytes for the C64
bridge.up("\x91".b)        # => "\e[A" (CRSR up)