Viewing revision r1 of CP437 — saved 2026-05-11 11:06 UTC .
“Initial seed content”
Jump to current version Full history

CP437

The "OEM-US" codepage IBM shipped with the original PC. 256
characters: ASCII 0–127 followed by accented letters, line-drawing
glyphs, block characters, and miscellaneous symbols.

Why it matters

ANSI art relies on the CP437 line-drawing chars (╔═╗, ▓░, etc.).
Without a CP437-aware font/terminal, BBS menus and art look like
random accented letters.

Renderers that get CP437 right

Inside ANetBBS

Terminal sessions default self.encoding = 'cp437'. When the BBS
writes a string, it gets .encode('cp437', errors='replace').

Stored ANSI screens and echomail bodies use a different trick:
each original byte 0xNN is stored as Python codepoint U+00NN
(latin-1 mojibake). On display, the BBS writes them back with
.encode('latin-1') so original bytes pass through untouched. This
way a CP437 client sees the original ANSI art exactly as the
author wrote it.

If you ever see Ä mojibake instead of clean lines, the
encoding round-trip broke somewhere. Fix is usually to use the
latin-1 raw write path instead of session.write().

Per-user override

/profile/edit → Codepage. Falls back to UTF-8 or Latin-1 for users
on terminals that don't speak CP437. Doesn't change how the BBS
stores data — only how it encodes outgoing writes.