<D <M <Y
Y> M> D>

[Comments] (2) They Said I Prob'ly Shouldn't Fly With Just One Eye: While waking up yesterday morning I had one of those semi-sensible waking up ideas, where I revamped my pretty-much-abandoned memorial page for my old BBS to reuse the actual old screens from the BBS. So the file listings would be colored text like they were on Da Warren, the homepage would be a copy of the BBS's main menu, etc. I could even put up ports of my WCCode masterpieces like The Online Hedgehog Detector and Eliminator, and Are You Online?

Well, looking at those old menus, that's probably not going to happen anytime soon because it would be a very confusing interface. But! To give the menus a proper look-see I ended up writing a program that converts my ANSI files to HTML. If you have any old ANSI files lying around it might work on them too. It even supports blinking ANSI, using the much-maligned (greatly-maligned?) <blink> tag. Well, the CSS equivalent.
☺☻♥♦♣♠•◘○X♂♀X♫☼▸    
◂↕‼¶§▬↨↑↓→←∟↔▴▾     
!"#$%&'()*+,-./0    
123456789:;<=>?@    
ABCDEFGHIJKLMNOP    
QRSTUVWXYZ[\]^_`    
abcdefghijklmnop    
qrstuvwxyz{|}~⌂Ç    ♥
üéâäàåçêëèïîìÄÅÉ    
æÆôöòûùÿÖÜ¢£¥₧ƒá    
íóúñѪº¿⌐¬½¼¡«»░    
▒▓│┤╡╢╖╕╣║╗╝╜╛┐└    
┴┬├─┼╞╟╚╔╩╦╠═╬╧╨    
╤╥╙╘╒╓╫╪┘┌█▄▌▐▀α    
βΓπΣσµτΦΘΩδ∞∅∈∩≡    
±≥≤⌠⌡÷≈°∙·√ⁿ²▪    

Here's the source: ansi2html.py. I've released it into the public domain.

Strangely enough, this program didn't already exist--HTML::FromANSI works for color codes but doesn't handle the CP437 extended ASCII characters that were a staple of DOS-based BBSes. There was a last burst of enthusiasm for ANSI files in general around 1999, when ansi2gif was released, but that seems to have been before web browsers had Unicode support, so nobody thought of putting it in the browser. And nowadays most people interested in ANSI art are into the scene stuff that mostly uses the block characters, and instead of cheap HTML translations you get cool things like lightboxes.

I wanted to bring all my tacky BBS screens into the browser and share them with you. Then I got this program working, actually saw all my tacky screens for the first time in years, and thought better of it. I will share one of my old Da Warren screens with you, to give you an idea of what the program can do. I've put it up at the ANSI2HTML web page. The graphics aren't bad because it's a plagiarized parody of someone else's ANSI advertising their pirate BBS. I used it as Da Warren's login screen occasionally.

There are a couple problems with the script. The first is that it needs some line-wrapping logic to simulate an 80-column screen. The second, which might be related, is that some ANSIs look crappy when it converts them to HTML. And--I'm embarrassed that this never occurred to me before--I'm not sure how an ANSI file is supposed to distinguish between an \x0a that's a newline and a \x0a that's INVERSE WHITE CIRCLE. Right now I treat 'em all like newlines.

But, at the very least I hope someone will get some use out of my Python dict mapping the IBM PC's special characters to numeric HTML entities. I forsee a renaissance of ZZT-style ANSI art games, old door games ported to the Web, etc.

PS: the official Unicode name of the ⌂ character is "HOUSE". I never mentally gave it a name, but "HOUSE"? Seriously? I'd have called it HOME PLATE.

Update: Added support for the simple cursor movement codes that can be simulated by adding newlines and spaces, which makes basically all ANSIs convert well enough that you can see what they are. Getting more complex than that will involve creating a virtual screen and drawing the whole thing on that before converting the finished product to HTML. Not worth it for me right now.

Uh, one more bit of art. This is how I signed my name in one of the BBS bulletins:

                                                ┌┐
                                               └┼┘
                                               ┌┼┐eonard
                                               └┘└


[Main]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.