Remember these specific #ASCIIart misrenderings using the wrong #codepage? Made actually a good testcase after adding codepage selection to my new "dos2ansi" tool 馃槣
https://github.com/Zirias/dos2ansi

Screenshot from #konsole (#KDE) running on #FreeBSD and using Microsoft's #Consolas font.

GitHub - Zirias/dos2ansi: Converter for old MS-DOS/ANSI.SYS text files

Converter for old MS-DOS/ANSI.SYS text files. Contribute to Zirias/dos2ansi development by creating an account on GitHub.

GitHub

Tested it on #Windows now. Ok, it works on some Windows-10 machine, the terminal nowadays can do both #utf8 output and interpret some #ansi sequences ...

But: You have to enable both explicitly in your code using some proprietary Console APIs 馃く
https://github.com/Zirias/dos2ansi/commit/5a85965d96d4456d1e739427122f66e89fb358b6

main: Configure console on Windows 路 Zirias/dos2ansi@5a85965

Fix console output on Windows by configuring the console to use UTF-8 and enable interpretation of ANSI escape sequences. This will only work correctly on recent Windows versions.

GitHub

New pre-release of dos2ansi: v0.2

* Works on #Windows, win32 binary (cross-compiled on #FreeBSD) attached
* Selectable input #codepage (so far only #cp437, #cp850 and #cp858)
* Selectable output format, #utf8, #utf16 or #utf16le, with or without #BOM

Still a few things to add, e.g. use #termcap/#terminfo or Windows Console API for "color output" when applicable ... we will see 馃槑

https://github.com/Zirias/dos2ansi/releases/tag/v0.2

Release dos2ansi-0.2 路 Zirias/dos2ansi

Selectable input codepage (so far only 437, 850 or 858) Selectable output format: UTF-8, UTF-16 or UTF-16LE Several smaller fixes, including correct operation on Windows

GitHub

Just released dos2ansi v0.4, with lots of #DOS #codepage s supported and a testmode to display them.

The next nice feature would be to use the actual terminal capabilities if output goes there. Very simple on *nix-like systems (#Linux, #FreeBSD, ...), just link #curses and use the termcap functions.

Thinking about #Windows again, either I keep relying on #UTF8 support (since #win7 IIRC? and still a bit buggy) and #ANSI sequences support (since #win10) .... OR I attempt to use the native #Console #API there (using special functions to write in #UTF16 and other special functions to set colors, which would require a major refactoring first 馃檮)

https://github.com/Zirias/dos2ansi/releases/tag/v0.4

Release dos2ansi-0.4 路 Zirias/dos2ansi

Add lots of DOS codepages Add a flag to use Euro-modified version where applicable Add a flag to wrap output in left-to-right override

GitHub

dos2ansi v0.6 released 馃コ

This version brings specialized writers for direct terminal output, using #terminfo (via #curses) on non-windows and configuring the #ANSI writer for 256 colors on #Windows >= 10, otherwise using a writer for the legacy Windows Console API.

It *should* work fine on any Windows and any Unix-like system offering terminfo/curses, but I could only test on #FreeBSD and Windows Server 2022 myself, so it would be nice if someone could test on older Windows as well as other *nix systems like #Linux 馃槈

https://github.com/Zirias/dos2ansi/releases/tag/v0.6

Release dos2ansi-0.6 路 Zirias/dos2ansi

Add terminfo-based color writer using curses on non-Windows systems. When built with curses (default), this is used for any output to standard out. Add a writer using legacy Windows Console API. Th...

GitHub

Released v0.6.1 just fixing one stupid little regression from refactoring: The terminfo writer must never be used when output does *not* go to stdout 馃檲

So far so good, I just thought there was yet another bug, testing redirected output on #Windows. I *always* got a file encoded as #UTF16LE, no matter which format I chose (and with #UTF8 chosen, the output was just broken). Meditated on the code for a while. Looks all perfectly good.

Finally, I tested in good old #CMD. And it worked perfectly well.

So, #Powershell is messing with the encoding of my stdout stream on redirects. Really? Really??? WTF, #Microsoft? How should that ever do any good? 馃く

https://github.com/Zirias/dos2ansi/releases/tag/v0.6.1

Release dos2ansi-0.6.1 路 Zirias/dos2ansi

Bugfix release, only use terminfo/curses writer on stdout

GitHub

Meanwhile released v0.6.2 with a few more (less important) bugfixes ...

... and working on a new feature, parse #SAUCE metadata.

#lldb (which comes with #FreeBSD base) is quite nice for some first testing 馃槑

SAUCE ref: https://github.com/radman1/sauce

GitHub - radman1/sauce: Standard Architecture for Universal Comment Extensions

Standard Architecture for Universal Comment Extensions - GitHub - radman1/sauce: Standard Architecture for Universal Comment Extensions

GitHub

Yep, progress ... unfortunately I don't own any "sauced" ANSI files making use of all possibilities of sauce, so it will be impossible to verify more things I'll add ....

If you have #MSDOS #ANSI files containing #SAUCE using the ansiflags or the fontname properties and/or containing additional comments, please let me know 馃槑 (maybe someone following #retrocomputing?)

There will probably be a "preview release" soon containing what I have so far ...

Did a "normal" release: dos2ansi v0.7

#SAUCE support isn't complete yet and parts of it are unfortunately untested (any help from #retrocomputing fans? 馃檹), but it's still a step forward, so, why not just release it 馃檲

https://github.com/Zirias/dos2ansi/releases/tag/v0.7

Release dos2ansi-0.7 路 Zirias/dos2ansi

Add SAUCE support (so far not parsing comments) If found in SAUCE, set width, blinking and codepage from it Bugfix: Stripping colors didn't work with terminfo/curses writer

GitHub

And dos2ansi v0.8 is here!

Not only because #SAUCE indeed had a few bugs in 0.7 .... there are also quite a few improvements.

For SAUCE, I now added #comment support ... and as I don't own any authentic #MSDOS file with that, I added some fake comment according to the spec to test it ... which is ... not so great ... please, if you have files using some more SAUCE features, contact me 馃檹

Download source and #win32 binary here:
https://github.com/Zirias/dos2ansi/releases/tag/v0.8

Release dos2ansi-0.8 路 Zirias/dos2ansi

FileStream improvements, use POSIX APIs (raw read/write) when available, otherwise disable stdio buffering Use a larger buffer size for stream I/O Make terminfo writer write to the stream, avoiding...

GitHub

Found a pretty nice font to go with #dos2ansi: #BlockZone.

It seems to contain a pretty complete set of glyphs (arabic and cyrillic work fine), and approximates the original #VGA looks very well! 馃憤

(Screenshots from #konsole on #FreeBSD again)

https://github.com/ansilove/BlockZone

#retrocomputing #MSDOS

GitHub - ansilove/BlockZone: A faithful recreation of the original DOS font.

A faithful recreation of the original DOS font. Contribute to ansilove/BlockZone development by creating an account on GitHub.

GitHub

Few features, but a lot of refactoring and internal improvements ... and #Windows users now get a program using "native" APIs ...:

here's #dos2ansi v0.9! 馃槑
https://github.com/Zirias/dos2ansi/releases/tag/v0.9

Screenshot shows displaying some random #SAUCE metadata, and the new (finally, lol) flag to display version info (also note the license matching my favorite OS, #FreeBSD)

#retrocomputing #MSDOS #ansiart

Release dos2ansi-0.9 路 Zirias/dos2ansi

Windows: use native win32 I/O, use unicode commandline Config: use stream output, add flags for help and version info Optimize stream I/O, minimize syscalls Fix some minor issues

GitHub

This will probably be the last release of #dos2ansi for quite a while, v1.1:
https://github.com/Zirias/dos2ansi/releases/tag/v1.1

Reason: It now has all the features I could think of initially ... and some nasty #win32-api-braindamage-related bug (only affecting #Windows of course) plus a few minor things I missed in v1.0 were fixed/improved. 馃檲

Sure, if someone has a great idea what should be added, I'm open to suggestions 馃槑

#MSDOS #VGA #ansiart #retrocomputing

Release dos2ansi-1.1 路 Zirias/dos2ansi

Service release: Bugfix: fix typo in help text Bugfix: [Windows] don't flush on Console output (this fails) Avoid excessive flushing, only flush the Stream pipeline by default, but not to the OS. ...

GitHub

Never say something is finished 馃檲

Browsing https://16colo.rs/ I found some #ansiart file that immediately had my attention because it crashed my #terminfo writer. Turns out attempting fallback to #termcap names makes no sense with terminfo ... although it shouldn't hurt either, but it did with "xterm-256color" on #FreeBSD for the "blink"/"mb" capability, "mb" returned something, but something "else" 馃檮 ... so I fixed that.

This file was strange enough to use it for more testing, it had "blinking" characters (according to #SAUCE), although ignoring that and using bright colors instead looked much more sane, see two screenshots for comparison (oh wow, #xterm can actually blink? although not like #VGA would...)

Anyways, I found a lot more things to optimize and fix in both my "plain ANSI" and "terminfo" color writers!

So, there will be #dos2ansi v1.2 soon. Will probably add some small feature first, just "because" 馃槀

16colo.rs - ANSI/ASCII art archive

16colo.rs is an archive of ANSI and ASCII art. Preserving artpacks released through the BBS underground artscene since the early 1990s until the present.

And here's the upcoming "feature" for #dos2ansi v1.2: Attempt to format #SAUCE comments nicely. 馃檲

It seems to be common practice to wrap comment lines in the middle of a word, so here's an attempt to be "smart" with this, adding an (optional) formatting heuristic:

* Empty lines are alway printed as is
* Same for lines containing "drawing" characters (anything >= 0xb0 in #cp437)
* Otherwise, if the last character of a line *and* the first of the next line are non-space, it's assumed to be one word
* Formatted lines are filled with as many complete words as possible, preserving spaces except at the end of the line
* More than two spaces at the end of a (raw) line are interpreted as a line break

Here are two real examples of the result, while the second already shows some classic shit-in-shit-out case (to fix this, I'd probably need a language model 馃槀)

And here it is, #dos2ansi v1.2:
https://github.com/Zirias/dos2ansi/releases/tag/v1.2

It's mostly optimizing the output and some subtle little bugfixes ... plus this feature to re-format #SAUCE comments 馃槑

So now I enjoy watching my #xterm blink on #FreeBSD 馃槀

#MSDOS #ansiart #VGA #retrocomputing

Release dos2ansi-1.2 路 Zirias/dos2ansi

Optimize and fix subtle bugs in generic ANSI writer Optimize and fix subtle bugs in terminfo/curses writer Default to 16 colors in generic ANSI writer Avoid attribute clearing sequences in generic ...

GitHub

And #pixelperfect (minus aspect ratio correction) #VGA display is possible in #xterm using bitmap(!) fonts I found here:
https://github.com/farsil/ibmfonts

As always, it wasn't *that* simple ... xterm expects a complete set of #VT100 drawing characters to be available, otherwise it will render its own which leads to funny color bugs at least with the "medium shade" used a lot in #ansiart ...

... so, let's patch the missing ones in (using dummy empty glyphs), which I did here in a #FreeBSD port for these fonts:
https://github.com/Zirias/zfbsd-ports/tree/local/x11-fonts/ibmfonts

Screenshots show #dos2ansi render some ansiart and its #SAUCE info, once in VGA-9x16 and for comparison in VGA-8x16 馃槑

GitHub - farsil/ibmfonts: IBM Fonts in BDF format

IBM Fonts in BDF format. Contribute to farsil/ibmfonts development by creating an account on GitHub.

GitHub

One more: #dos2ansi rendering some #ansiart in #xterm on #FreeBSD using bitmap IBM fonts, here VGA-8x16.

#retrocomputing

I'm about to prepare yet another release, #dos2ansi v1.3.

Finding these bitmap fonts triggered two things:

1. I realized dos2ansi needs a mode to NOT attempt to mimic #VGA looks by chosing more similarly looking characters: A font recreating the orignal IBM fonts probably won't have glyphs for these other characters (and the original ones will look, well, original 馃槣 ...)

2. It gave me the idea that I now had everything in place for some sort of "ANSI viewer", just needs a script to tie together dos2ansi, #xterm, #less and the #ibmfonts. So, here it is: showansi. It should work with other X terminals, pagers, fonts, for configuration see the updated README:
https://github.com/Zirias/dos2ansi

The script first calls dos2ansi to query some #SAUCE metadata it then uses to pick the most appropriate font, window size and title for xterm.

The screenshot uses completely unconfigured Xorg and xterm, to show the script sets everything as needed.

#ansiart #retrocomputing

GitHub - Zirias/dos2ansi: Converter for old MS-DOS/ANSI.SYS text files

Converter for old MS-DOS/ANSI.SYS text files. Contribute to Zirias/dos2ansi development by creating an account on GitHub.

GitHub

Released #dos2ansi v1.4:
https://github.com/Zirias/dos2ansi/releases/tag/v1.4

Once again I have the feeling it's finally "feature complete" ... I hope it is this time 馃檲

This release mainly improves the "showansi" script. it doesn't use environment variables any more (for security reasons, running `eval` on stuff partially obtained from the environment is a bit risky indeed) but uses configuration files instead. It also avoids creating a temporary FIFO for reading #SAUCE metadata now.

Screenshot: showansi automatically picking the VGA-9x16 font as indicated in SAUCE.

#retrocomputing #MSDOS #ANSIart #VGA

Release dos2ansi-1.4 路 Zirias/dos2ansi

Sauce query: Output in UTF-8 instead of CP-437 Sauce query: Option to also query the comment Sauce query: Option to toggle quoting lines in single quotes showansi (non-Windows only): Security: Har...

GitHub

Oh freakin hell, of course this happens directly *after* release: I found some #ansiart file that really uses every obscure display-related feature of ANSI.SYS, and as a result, #dos2ansi v1.4 just renders garbage 馃槧

It now works with the latest commit, I had to implement:

- absolute cursor positioning
- cursor position saving and restoring
- all the erasing (line/screen) commands
- and additionally at least ignoring sequences to set the screen mode 馃く

Why is anyone doing that? First I thought save bandwidth for BBS, but this file has 7620 bytes, and processed with -AId flags (so only sequences used also available in ANSI.SYS), it shrinks down to 5906 bytes even using #UTF8... I really don't understand that 馃檲

Here's this file: https://16colo.rs/pack/arc-17/M0D-RMS1.ASC

#dos2ansi v1.5 will be there soon I guess...

2000/arc-17/M0D-RMS1.ASC

arc

It's done, #dos2ansi v1.5 is here:
https://github.com/Zirias/dos2ansi/releases/tag/v1.5

Apart from supporting all the cursor movement and screen erasing sequences that were needed for that silly file I found, there's now also support for the screen mode setting from ANSI.SYS (with non-text modes silently ignored).

There are also tons of little improvements to the "showansi" script, which should now work very well as a generic DOS ANSIart viewer picking reasonable defaults (and making it easy to override them if really necessary).

Example screenshot includes rendering this silly file again 馃槀

Have fun, and if you need some files to display, have a look at https://16colo.rs/

#MSDOS #ANSIart #retrocomputing

Release dos2ansi-1.5 路 Zirias/dos2ansi

Improved ANSI.SYS compatibility, support all cursor movements, all erase commands, and setting screen mode Add a screen height to restrict cursor movements and erasing to visible "window" Collect a...

GitHub

#dos2ansi v1.6:
https://github.com/Zirias/dos2ansi/releases/tag/v1.6

* Fix cursor movement again, it never wraps or scrolls.
* Many smaller improvements to the #showansi script
* Add an example configuration using scalable fonts from https://int10h.org/oldschool-pc-fonts/ instead of the default bitmap fonts

Scalable fonts are a tradeoff here. You get freely configurable sizes and correction of aspect ratio. You lose pixel-perfect (perfectly sharp) display. You can't have both, unfortunately.

Screenshot shows scalable fonts 馃槈

#MSDOS #ANSIart #retrocomputing

Release dos2ansi-1.6 路 Zirias/dos2ansi

Cursor movement strictly restricted to the current line or the current virtual screen (might fix rendering of really broken input files) Error out when rendering metadata is requested without input...

GitHub

#dos2ansi v1.6.1 (a pure bugfix/service release):
https://github.com/Zirias/dos2ansi/releases/tag/v1.6.1

* Fix possible crash (馃檲) when querying for font or codepage on a file with a non-text #SAUCE type.
* Try to parse something meaningful even out of partially broken SAUCE data

Yep, the possible crash was the reason to create a release even for a pretty "small" bugfix. 馃檮 Chances are nobody would have noticed though, the SAUCE *display* was not affected, only the machine-readable query (-q).

Screenshot: The "offending" file. It even had literal ",1" written in the month field of the SAUCE date, but obviously meaning January here 馃槀

#MSDOS #ANSIart #retrocomputing

Release dos2ansi-1.6.1 路 Zirias/dos2ansi

Bugfix/service release. Fix possible crash when querying font/codepage on a file with non-text SAUCE type Try to extract meaningful data even from partially broken SAUCE

GitHub

And now there's even #dos2ansi v1.6.2: https://github.com/Zirias/dos2ansi/releases/tag/v1.6.2

The good thing is: The issues I'm fixing here are getting more and more obscure 馃槀

First I noticed #xterm doesn't accept all #utf8 for its '-title' option, no matter what. But it *does* support the escape sequence to set a title, so, why not use this instead.

Having added support for that (and also optionally for setting the window size using an escape sequence), I had a look at quoting again. Indeed, #showansi failed for e.g. file names containing #shell special characters.

Therefore added a *safe* quote function. The downside is, it requires #sed now. Well ....

Screenshot shows both improvements, I picked a "maximum weird" file name and used a file that has an '枚' in its title 馃コ -- in the showansi debugging output, you can see the quoting in action 馃く

#MSDOS #ANSIart #retrocomupting

Release dos2ansi-1.6.2 路 Zirias/dos2ansi

Bugfix/service release: showansi: Safely quote all terminal and dos2ansi args showansi: Default to setting window title using an escape sequence, this avoids an issue of xterm not accepting utf8 f...

GitHub

Yet another revision, #dos2ansi v1.6.3
https://github.com/Zirias/dos2ansi/releases/tag/v1.6.3

--- brings yet another subtle bugfix in #showansi: To set the title with an escape sequence, it uses "printf %b" with its \-notation for control characters, so literal backslashes in the title must be escaped as well 馃檲

Apart from that, added nice "portability bikeshed":

- Removed the dependency on 'sed' again, quoting/escaping strings for 'eval' *can* be done in pure #POSIX #shell script.

- Added proper detection of the POSIX shell to my #zimk build system, along with variables to override the choice. Used that to generate the shebang for #dos2ansi. Really an awesome way to write /bin/sh without writing /bin/sh 馃槀 (rumors say there *are* POSIX systems with the compliant shell in a different path ...)

Screenshot: Yet another file with "weird" title from #SAUCE

#ANSIart #MSDOS #retrocomupting

Release dos2ansi-1.6.3 路 Zirias/dos2ansi

Bugfix/service release: showansi: Fix quoting of title when using escape sequence to set it showansi: Eliminate dependency on sed showansi: When building from source, use detected POSIX shell inst...

GitHub

I just released #dos2ansi v1.7, which includes one final bugfix: Quoted output of #SAUCE metadata should use proper "shell-style" quoting, so it can be directly consumed by #showansi, which it does now. Plus #showansi got a (tiny) bit of optimization.

https://github.com/Zirias/dos2ansi/releases/tag/v1.7

Well, just after releasing, I found more stuff to tackle. No, not new bugs at least.

But more weirdly broken ANSIart files. Example:
https://16colo.rs/pack/root0297/FU-B%26B.ANS

This one *has* SAUCE metadata, but it's not properly "hidden" behind a DOS EOF character (0x1a), which means even 'type' on a real DOS machine will output the SAUCE gibberish below the pic 馃檲

So, there *might* be a v1.8 adding more heuristics to detect and parse more broken SAUCE ... 馃槀

#MSDOS #ANSIart #retrocomputing

Release dos2ansi-1.7 路 Zirias/dos2ansi

Fix optional quoting in SAUCE query to use shell style Optimize showansi a bit

GitHub

#dos2ansi v1.8 released!
https://github.com/Zirias/dos2ansi/releases/tag/v1.8

There's some major rework inside adding support for seekable streams, which was necessary to implement the logic detecting #SAUCE even when the preceding DOS EOF character is missing.

Quite some improvements to the #showansi script as well, now comes with "fontsets" (explained in the comments in these and the config file) 馃槑

Plus added a manpage. Wanted a single source of truth (shared with the help output) and didn't find a good tool for that, so I quickly came up with my own:
https://github.com/Zirias/mkclidoc
It's bundled with dos2ansi now. Can produce man in both classic troff and BSD mandoc. The default choice is based on `uname` for now, tested on #FreeBSD and #Debian.

#ANSIart #MSDOS #retrocomputing

Release dos2ansi-1.8 路 Zirias/dos2ansi

Support seekable streams, this allows to read SAUCE first without buffering the whole file detect SAUCE even without a DOS EOF character Add a manpage, support both classic man (troff) and BSD m...

GitHub

Released: #dos2ansi v2.0
https://github.com/Zirias/dos2ansi/releases/tag/v2.0

The real "visible change" is documentation. #showansi now got a manpage as well, and the one for #dos2ansi improved a lot. Also better build instructions and some updates/corrections in the README. With these docs, you can hopefully make it do exactly what you want 馃槈

Also, the build system (my own homebrewn #GNU #make framework) got lots of improvements and fixes.
https://github.com/Zirias/zimk/

#ANSIart #MSDOS #retrocomputing

Release dos2ansi-2.0 路 Zirias/dos2ansi

Adjust a few minor things in code Improve and complete documentation (man and html) Many fixes and improvements to the build system

GitHub

I just pushed an official #FreeBSD port of #dos2ansi 馃槈

http://www.freshports.org/converters/dos2ansi

FreshPorts -- converters/dos2ansi: Converter for old MS-DOS/ANSI.SYS text files

A tool to convert MS-DOS/ANSI.SYS text files to modern terminals. This tool converts MS-DOS text files using ANSI.SYS escape sequences to a format a modern terminal can display. The output will use a Unicode encoding of characters and only ANSI SGR escape sequences to set basic foreground and background colors, intensity and blinking attribute. The input is expected to use CP-437 or one of the other supported DOS codepages.