Processes legacy BBS-style ANSI art (ACiDDraw, PabloDraw, etc.) to UTF-8.
Escape codes and line endings are processed for terminal friendliness.
ansiart2utf8
Converts ANSI art to UTF-8 encoding, expands cursor forward ESC sequences
into spaces, wraps/resets at a specified line width, sends result to STDOUT.
Leave the [FILE] parameter empty to read from STDIN.
USAGE: ansiart2utf8 [OPTION]... [FILE]...
OPTIONS
-bytes uint
MAXIMUM OUTPUT BYTES PER-ROW (0 = NO LIMIT)
-debug
DEBUG MODE: line numbering + pipe @ \n
-w uint
LINE WRAP WIDTH (default 80)
-x ANSI TO XTERM-256 COLOR SUBSTITUTION
(to overcome strange terminal color scheme palettes)
To build:
- Install the latest Go compiler from https://golang.org/dl/
- Install the program:
go install github.com/BourgeoisBear/ansiart2utf8/ansiart2utf8@latest
To see the result, make sure that your terminal font provides glyphs for the old CP437 box drawing characters.
Here are a few fonts that will do:
:e ++enc=cp437
- PabloDraw, an ANSI drawing program for Windows
- ACiDDraw, an ANSI drawing program for DOS
- Lots of ANSI art to be seen here:
http://blocktronics.org/artpacks/ - Ultimate guide to pimping your terminal:
http://mewbies.com/acute_terminal_fun_table_of_contents.htm - A very clear mapping of code page 437 characters to Unicode at Wikipedia:
https://en.wikipedia.org/wiki/Code_page_437#Characters - Helpful references on ANSI escape codes:
https://en.wikipedia.org/wiki/ANSI_escape_code
https://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html