CP437 display on console

I can't concieve why it is so hard to get a console to display all 255 chars of the 437 codepage.

So, what do I have to do to set up the text console in a way that
for (int i=0; i<=255;i++) printf ("%c",i);
will display all of codepage 437 glyphs correctly?
 
I tried bsdconfig /console font setting, I sat it to the cp437 font. It didnt cut it. Toyed around with all its settings. Searched around the net, but nada.
 
CP437 is the original IBM charset, VGA default, you name it, to this day every computer has it etched into the graphics cards ROM, this is the charset that the computer boots into... (even DOS could display it)
...
yet I am unable to see it (the sad part is, that not only on FreeBSD, but neither on Linux nor on Windows does this work)
 
Terminals, consoles, etc. are set to UTF-8. Loading a font doesn't change the character set encoding.
 
Call me illiterate, I have read the Handbook\Localization chapter, and still cant figure it out.
Any help is appreciated.
 
The key issue here is the difference between text encoding and the glyphs stored in a font.

Text encoding (simplified) assigns a number to a character. The US-ASCII standard uses only 7 bits for that. Unicode uses a lot more (17 "planes" of each 16bit).

A font on the other hand contains the graphics data for glyphs (the visual presentation of a character) that can be identified "somehow". In a "modern" font, each glyph has an actual name for identification, and contains other metadata, like e.g. the Unicode codepoint.

IBM's hardware font has just 256 glyphs, identified simply by an 8bit number. These numbers are also known as the encoding "CP437". The lower 7 bits correspond to US-ASCII. So, back at the time, displaying a character just meant using the glyph at exactly the position of the (encoded) character. You won't find such a 1:1 mapping between character and glyph any more nowadays, for lots of reasons.

When you output a character to some terminal, all you need to know is the codepoint in the text encoding you're using. Finding the correct glyph for display is the terminal's job (which it might also delegate to some font rendering library, e.g. when it's an X11 terminal emulator).

As SirDice already mentioned, vt(4) only supports ASCII and UTF-8. ASCII only supports 128 code points, so you'll use UTF-8 (which is a representation of Unicode). Every character in CP437 is also available in UTF-8 ... what you have to do is translate CP437 to UTF-8 before "printing" to the terminal, this can e.g. be done using iconv(3).
 
this can e.g. be done using iconv(3).
Tried it for fun and found there's actually a caveat about that: CP437 codepoints 0x00 to 0x1f are context dependent, they can mean some control characters or actually printable symbols, and you obviously want the latter. But iconv(3) interprets them as control characters and I found no way to change that ....

So, I added a static table of Unicode codepoints in UCS-2 (16bit) for them in order to print them correctly, making this horrible example program even more horrible ?:

C:
#include <stdlib.h>
#include <iconv.h>
#include <unistd.h>

static const uint16_t nonprint[] = {
    0x0020,0x263A,0x263B,0x2665,0x2666,0x2663,0x2660,0x2022,
    0x25D8,0x25CB,0x25D9,0x2642,0x2640,0x266A,0x266B,0x263C,
    0x25BA,0x25C4,0x2195,0x203C,0x00B6,0x00A7,0x25AC,0x21AB,
    0x2191,0x2193,0x2192,0x2190,0x221F,0x2194,0x25B2,0x25BC
};

static char ucs2[32*4];
static char cp437[224*2];
static char utf8[256*2*4];

int main(void)
{
    char *up = ucs2;
    for (int i = 0; i < 32;)
    {
        *up++ = nonprint[i] >> 8;
        *up++ = nonprint[i];
        *up++ = 0;
        *up++ = ++i % 16 ? ' ' : '\n';
    }
    up = ucs2;
    size_t us = sizeof ucs2;
    char *o = utf8;
    size_t os = sizeof utf8;

    iconv_t cd = iconv_open("UTF8", "UCS-2");
    iconv(cd, &up, &us, &o, &os);
    iconv_close(cd);

    char *p = cp437;
    for (int i = 32; i < 256;)
    {
        *p++ = i;
        *p++ = ++i % 16 ? ' ' : '\n';
    }
    p = cp437;
    size_t ps = sizeof cp437;

    cd = iconv_open("UTF8", "437");
    iconv(cd, &p, &ps, &o, &os);
    iconv_close(cd);

    write(STDOUT_FILENO, utf8, sizeof utf8 - os);
}
 
(the sad part is, that not only on FreeBSD, but neither on Linux nor on Windows does this work)
No modern OS would ever use this old 8bit vendor-specific encoding for its text representation, so this is expected.

Just fiddled with a different approach, a filter accepting CP437 as input and translating it to UTF-8:
C:
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static const uint16_t cp437low[] = {
    '\n',  0x263A,0x263B,0x2665,0x2666,0x2663,0x2660,0x2022,
    0x25D8,0x25CB,0x25D9,0x2642,0x2640,0x266A,0x266B,0x263C,
    0x25BA,0x25C4,0x2195,0x203C,0x00B6,0x00A7,0x25AC,0x21AB,
    0x2191,0x2193,0x2192,0x2190,0x221F,0x2194,0x25B2,0x25BC
};

static const uint16_t cp437high[] = {
    0x2302,
    0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7,
    0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5,
    0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9,
    0x00FF,0x00D6,0x00DC,0x00A2,0x00A3,0x00A5,0x20A7,0x0192,
    0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA,
    0x00BF,0x2310,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB,
    0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
    0x2555,0x2563,0x2551,0x2557,0x255D,0x255C,0x255B,0x2510,
    0x2514,0x2534,0x252C,0x251C,0x2500,0x253C,0x255E,0x255F,
    0x255A,0x2554,0x2569,0x2566,0x2560,0x2550,0x256C,0x2567,
    0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256B,
    0x256A,0x2518,0x250C,0x2588,0x2584,0x258C,0x2590,0x2580,
    0x03B1,0x00DF,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
    0x03A6,0x0398,0x03A9,0x03B4,0x221E,0x03C6,0x03B5,0x2229,
    0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
    0x00B0,0x2219,0x00B7,0x221A,0x207F,0x00B2,0x25A0,0x00A0
};

static char inbuf[1024];
static char outbuf[4*sizeof inbuf];

static void toutf8(size_t *outsz, uint16_t c)
{
    if (c < 0x80)
    {
        outbuf[(*outsz)++] = c;
        return;
    }
    unsigned char lb = c & 0xff;
    unsigned char hb = c >> 8;
    if (c < 0x800)
    {
        outbuf[(*outsz)++] = 0xc0U | (hb << 2) | (lb >> 6);
        outbuf[(*outsz)++] = 0x80U | (lb & 0x3fU);
    }
    else
    {
        outbuf[(*outsz)++] = 0xe0U | (hb >> 4);
        outbuf[(*outsz)++] = 0x80U | (hb << 2) | (lb >> 6);
        outbuf[(*outsz)++] = 0x80U | (lb & 0x3fU);
    }
}

int main(int argc, char **argv)
{
    int printlower = 0;
    if (argc > 1 && !strcmp(argv[1], "-p")) printlower = 1;

    size_t insz;
    while ((insz = fread(inbuf, 1, sizeof inbuf, stdin)))
    {
        size_t outsz = 0;
        for (size_t inpos = 0; inpos < insz; ++inpos)
        {
            unsigned char c = inbuf[inpos];
            if (printlower && c < 0x20) toutf8(&outsz, cp437low[c]);
            else if (c >= 0x7fU) toutf8(&outsz, cp437high[c-0x7fU]);
            else outbuf[outsz++] = c;
        }
        size_t outpos = 0;
        while (outpos < outsz)
        {
            size_t outwr = fwrite(outbuf + outpos, 1, outsz - outpos, stdout);
            if (!outwr) exit(EXIT_FAILURE);
            outpos += outwr;
        }
    }

    return EXIT_SUCCESS;
}

This is just standard C (doesn't even use iconv(3), so it needs hardcoded tables for all non-ascii characters) and should therefore work on any OS, as long as UTF-8 encoding is used. By default, it leaves control characters as is, but has the switch -p to display them, in which case it will interpret 0 (NUL or zero) as a newline, because this is the only codepoint that doesn't have any glyph associated in CP347.

Example "in action":
1705069726336.png
 
So, what do I have to do to set up the text console in a way that
for (int i=0; i<=255;i++) printf ("%c",i);
will display all of codepage 437 glyphs correctly?
This can never work. Let me give you two simple examples: If you print the character for i=10, the console will end the current line and go to the next line. That's because char(10) is newline a.k.a. "\n". Similarly, if you print the character for i=27 (a.k.a. escape or char(0x1B), what happens depends on the next few characters: If they happen to be "[31m", then everything will be printed in red from here on.

The console is not a graphics ROM rendering machine. It is a terminal emulator. Terminals have some interestingly complex functions. One is to interpret simple control characters such as newline, carriage return, backspace and such. The next one is to interpret less simple control sequences that for example change colors of text, clear the screen, or move the cursor. Another layer of their functionality is to decode the incoming stream of characters to translate it from the encoding currently in force (which may be UTF-8 or iso8859-1) to what glyphs can really be displayed. And it seems that CP437 is not an encoding that people care about.
 
First of all thank you all for clarifying this point.

SirDice:
Why do I need this?
Short answer: because.
Long answer:
To answer your question, I did not tell nothing about me. I am a programmer, I worked mainly with databases, VB,C#,C++,C.
I am living in Transylvania (place in Romania) and born 1981. In my childhood I had contact with DOS, and in those early day computers the IBM standard (aka. CP437) was the defacto standard. In some ways it still is today, as it is present in every computers ROM, this is the hardware default. I always viewed this encoding as the textual representation of a 8 bit integer, this was the "image" of 8 bits for me. Its understood that this standard is overpassed and became obsolete for various reasons, nevertheless I prefer seeing some "meaningfull" graphical representation when I view raw binary data in a text editor or - why not - in a console, instead of seeing whitespace for most of the characters.
Point number 2: it wasnt such a bad encoding that it deserves obliteration, and to be made nearly impossible to use it on my own computer if I wish so.

zirias@ :
Wow, huge thanx fly out to you. You solved my problem. I really wanted to print this set of glyphs from C (but perhaps without the burden of tedious conversion). Thank you for your time&effort for posting a sample code. You hit a sweat spot for me.

ralphbsz :
Thanks for clarifying. Yes its true, the terminal is not a graphics ROM rendering machine, it is much more as you explained it well.
but...
I'd like to think about it as if it were. Among the multiple functionalities it carries out, it ought to be also the most basic thing: a text rendering machine that uses the built in hardware capabilities, or at least it lets you configure it to do so. And it comes short of this...

These were my 2 cents.
 
This can never work. Let me give you two simple examples: If you print the character for i=10, the console will end the current line and go to the next line. That's because char(10) is newline a.k.a. "\n". Similarly, if you print the character for i=27 (a.k.a. escape or char(0x1B), what happens depends on the next few characters: If they happen to be "[31m", then everything will be printed in red from here on.
Actually, this is just another property of the encoding used (there's a reason the C standard doesn't require a fixed encofing for the newline character, for example). US-ASCII put all control characters in the range 0x00-0x1f. Nowadays, every 8bit encoding (or, 8bit representation, like UTF-8) is fully ASCII compatible, therefore the control characters are in this range.

CP437 is "special" in also having printable characters there (except for codepoint 0), so interpretation depends on context...

And it seems that CP437 is not an encoding that people care about.
True in general, but there are certain areas where it survives. Emulation and preservation of old software would be one of them ... graphics characters were used a lot for designing user interfaces. Also other "artwork" ("(extended) ASCII Art", "PETSCII Art", ...) used one of these historic encodings, and while it can be displayed almost everywhere by translating it to Unicode, the original files will keep their original encoding ... back in these days, the set of available glyphs on a machine made for their "character", there are iconic PETSCII works on the C64, EXTASCII works on the PC, and so on, and looking at them, you'll immediately recognize the machine they were made for. An example still in use sometimes is the NFO file that comes with PC crack releases ... to this day, CP437 is one of the most used encodings in these files.

Having mentioned PETSCII, this came with two hardware fonts on the C64 and no 1:1 mapping encoding<->font, instead the fonts included "reverse" versions of every glyph and displaying required some stateful lookup of the correct "screen codes". It was simpler on the original IBM PC, the font followed CP437 1:1 and you just needed to know whether the low area (<0x20) should be printed or interpreted as control characters. That's a reason I even used CP437 with a matching font used from RAM on the C64 in the past (the other reason being it also has a useful set of accented characters in addition to graphical symbols), to create a docs viewer for a crack release.

Point number 2: it wasnt such a bad encoding that it deserves obliteration, and to be made nearly impossible to use it on my own computer if I wish so.
I see your point, but with Unicode around, what's the point of using any 8bit encoding (offering just a very limited set of characters) on a modern machine? Many still support the ISO-8859-* family of 8bit encodings (at least they are standardized), but CP437 is also proprietary...

Baseline, the characters aren't lost, you just need a font having all the required glyphs and use a Unicode encoding today. If you want it simpler, use a simpler machine back from these days ?
 
ralphbsz :
Thanks for clarifying. Yes its true, the terminal is not a graphics ROM rendering machine, it is much more as you explained it well.
but...
I'd like to think about it as if it were. Among the multiple functionalities it carries out, it ought to be also the most basic thing: a text rendering machine that uses the built in hardware capabilities, or at least it lets you configure it to do so. And it comes short of this...
Elaborating on this a bit as well:

First, please look at my example of the C64 (as well as other Commodore machines using the PETSCII encoding): A 1:1 mapping "encoded character to font/screen" was a special case even back then. The CHROUT KERNAL function of a Commodore OS does some translation, even statefully considering whether "reverse mode" was currently turned on.

Second, what you'd like to see is a terminal mode doing "no processing at all". But this requires there is such a thing as a hardware font, with glyphs organized using "screen codes". That might be the case when your output device is directly EGA/VGA hardware. It would be utterly meaningless for e.g. an X terminal emulator. We're talking about different layers of abstraction here. It would be a horrible idea to build intrinsic knowledge about the display hardware into a terminal...

Third, the reason you'd like to see this is displaying the glyphs available in CP437. Then, you'll just be told "use Unicode", and indeed, there are Unicode codepoints for every single character available in CP437. So, there's a sane and correct way to display them on a modern terminal (assuming a font having the glyphs is in place).
 
well well well :))
Someone is smiling inside me.
We are a group of people best described in layman terms as "computer guys", sharing the same passion about computers and FreeBSD, talking about technical stuff on an appropriate forum.
Yet we arrive at the oldest of sciences: philosophy.
Don't get me wrong, I absolutely mean it in the most positive sense.
I honestly think that philosophy is the father of all sciences and it is the basis of logical thinking.
(you see I am a philosopher too...)

For me the greatest thing in programming and computers besides the practical side of it - that it gives a solution to a problem - is that it gives me the joy of creation, the joy of seeing some idea of mine being materialized (aka. I wrote a program, and I see it working). But not only that, when you write a program not because its your job and you have to, but out of joy, then you appreciate more how elegant, how beautiful, how well done is the code itself.
And beauty lies in simplicity.

With all that said, in this setting it makes no sense to think "it is pointless to use 8bit 1:1 text representation" or "I do not adhere to this standard or that".
You are a child playing in your own playground, you are the master of your play. You are also learning the toy. How and what you can bring out of it. If the play is such, than it is even mandatory to forget all preconceptions, what you already know, to be free to experience new ways of thinking and playing.

It may seem to you, that this sort of thing is silly or childish.
But I strongly believe that this sort of play, can be the soil or the beginning of some magnificent "real life" work.

So in this fashion, not only that an 8bit 1:1 text representation is ok, heck, 6 bits give me enough symbols for a minimal alphabet. (think of those 32k asm demos, how great they were).
My toy is FreeBSD. I sort of like CP437, I am used to it, it is simple to use it, program it, it has all the symbols I need for my play.
But I am not the master of my toy, because I dont know it well enough. So I turned to the masters of the toy. Help was given to me. I am happy. Story checks out.

(well sort of, the little devil says inside me, I still want a terminal that displays cp437 for me. Maybe I'll write it some day
. He he he. In that case I promise to port it back to you folks :)

Cheers!
 
If we think of the VGA screen as a 2D array of character positions (typically 24x80, larger in higher resolutions), then it is possible to make each position display one of the 256 ROM character map positions. In really old computers (Commodore Pet, TRS-80, some minicomputers that had direct video output, for example Motorola or Four Phase) that was done by writing an 8-bit byte into the memory mapped display. Later computers had bit-mapped displays, where each bit of the memory map corresponds to one pixel on the screen; on those there are very simple routines to copy all the pixels required for a character from the character map in ROM to the pixel memory; those routines were typically in ROM too.

For the VGA of the IBM PC, I don't know exactly how this is done at the memory map or register level. But I know that for DOS, there are libraries that allow displaying any ROM character in any character position. I assume that there are versions of these in Unixes, and in FreeBSD. As an example, look at "man 3 vgl", which is already pretty complex.
 
Yes, DOS uses, or more correctly said lets programs access direct video memory where textmode is mapped as color, char tuple of bytes.

I looked at vgl, it seems to be a simple graphics library (which does not use X).
It could be a good start.
Another interesting question would be, how to access raw text mode capabilities in FreeBSD (as to say the raw hardware
eg. vid. memory, changing the glyphs, color definitions and so on). Ncurses does something very similiar, but it still relays on the terminal capabilities.
 
you see even text mode is a standard, a hardware standard instead (which by the way does use 1:1 8 bit cp437 as its default :)
It would be a sad day, when modern computers stop supporting it...
 
Many consider discussions about design and architecture of systems (as opposed to just coding something) "philosophical". You won't find universal agreement about this, but it certainly has its merits, so, fine for me....

For me the greatest thing in programming and computers besides the practical side of it - that it gives a solution to a problem - is that it gives me the joy of creation, the joy of seeing some idea of mine being materialized (aka. I wrote a program, and I see it working). But not only that, when you write a program not because its your job and you have to, but out of joy, then you appreciate more how elegant, how beautiful, how well done is the code itself.
And beauty lies in simplicity.
Yep. Well, whether there's more "joy" in it outside of a work context, I don't know ... I can see that "feeling", but on the other hand, I also see a lot of people at work who find this joy in coming up with elegant and simple solutions there ... anyways, simplicity is also an important engineering objective.

With all that said, in this setting it makes no sense to think "it is pointless to use 8bit 1:1 text representation" or "I do not adhere to this standard or that".
I think you have an error in your chain of thought here, by not considering the context. The IBM PC was designed as a typical microcomputer of its time, very much like the "home computers", just with a focus on business use. Still it was meant to be used "as is", as a single system. It featured an "open system architecture", yes, still the available components were pretty tightly coupled, and for some standalone microcomputer, this wasn't an issue at all. With that setting, deciding for one(!) encoding and shipping a "hardware font" with glyphs organized by that encoding certainly was the simplest solution and a good overall match.

Now, consider "terminals". They were "hardware user interfaces" (a screen with a keyboard). They were meant to be wired to larger systems (mainframes and minicomputers). So, the design was that of a "distributed system" from the very beginning .... the simplest possible design was to agree about a text encoding used for communication between the computer and the terminal. Dropping that abstraction would have meant that every software running on the computer would need intimate knowledge about the terminal currently used (available glyphs and how to adress them, available keys and their position in the keyboard matrix, ...). This wouldn't be "simple" at all. Even with just having text in a common encoding on the interface between computer and terminal, there was still an issue with the extended capabilities of terminals that used largely different extended control sequences typically started by the ESC control character ... that's btw how termcap(3) came to be, adding a software layer abstracting this stuff, so individual programs didn't have to care.

With the rise of the internet, the model of a "standalone" system died, sooner or later "everything was connected" and therefore systems were distributed by nature and interoperability really mattered. Unix-like systems were ported to the IBM PC (BSD) or created there from scratch (Linux), existing systems gained "complexity" that now was just necessary (Windows) to avoid even more complexity sprinkled everywhere ...

To put it more general again: Simplicity is no absolute. What you aim for is the most simple overall solution matching the requirements. A component being "over-simplified" (like here the terminal) would cause a huge amount of complexity in everything using it (like here every single piece of software), therefore increasing the overall complexity of the system.

My toy is FreeBSD. I sort of like CP437, I am used to it, it is simple to use it, program it, it has all the symbols I need for my play.
The "sanest" place to play with that would be a machine running the original OS (PC-DOS / MS-DOS) of the original IBM PC. Or nowadays of course, a suitable emulator, like e.g. emulators/dosbox or emulators/dosbox-x.

the little devil says inside me, I still want a terminal that displays cp437 for me. Maybe I'll write it some day
I don't see any really useful purpose, but, it certainly sounds like a lot of fun! I guess you could even do it in a pretty portable way by implementing a "virtual terminal" on top of another one "speaking" UTF-8 ?
 
SirDice: This one with XY problem got me thinking. I read the article on wikipedia you pointed out.
Maybe I was'nt clear enough, about what I wanted to achieve with this, or what the source of my problem is.
and also to zirias@:
I think I understand what you are saying.
I understand the concept of hardware abstraction, it is a very useful thing, indeed when you have bunch of different hardware terminals each with different capabilities, you need a unified way to query or use their capabilities, the same with video cards nowadays, or any other peripheral, we use them through drivers, hiding their intrinsic functioning or internal structure. We dont program directly the hardware anymore, and thats a good thing.
But as you you said, those hardware terminals are history by now, most of us know of them only from history books.
What it remained is individual computers, laptops, mainframes, interconnected by networks and the internet. every one of them having some sort of graphic device, the graphic card. I assume I am not wrong if I say that all graphic cards today share as a common standard the textmode, which still uses 8 bit representation 16 colors, and as heritage all use as the default cp347.
All I say is that I find a bit antagonistic the all modern unix like operating systems are still embracing this old concept of
terminal capabilities and what not, where those devices are long gone. Instead what we have is a fairly standard text device
(aka the textmode) which is the same on every computer. The terminal capabilities are always the same, you can safely assume that a program written for text mode will run and look alike on any system, even on raspberry pies.
I do not even say that its a bad thing, let be historical devices be supported, why anger grandpa?
All I am saying is why it is not the standrad to use the builtin capability of every graphic card, the textmode and its 8 bit cp437 encoding. When I want to display random 8bit bytes in text mode, I want to see some standard graphic representation for every one of them (and there is a standard, sitting rigth in the ROM), I dont want to see blank for most of them, or some of them interpreted as commands. Maybe its just me, I am the visual type. It s a whole different question what encoding I use when I communicate in e-mail. But it bothers me the most, that its there, the hardware is capable of it (aka showing me some decent graphic representation of a byte), but the software is hiding it from me for no good reason. You are rigth it is not such a big deal, just write a program for it. The original question I posed was how do I setup my terminal to do that. If I type "cat some_binary_file" I just want to see cp437 rolling by. Why? I dont know. I am a sick person enjoying that. And I was enquireing about the possibility of fulfilling this weird joy of mine :)
Thats all.
 
But as you you said, those hardware terminals are history by now, most of us know of them only from history books.
They're still there, just typically not as dedicated hardware any more, but a piece of software instead.

What it remained is individual computers, laptops, mainframes, interconnected by networks and the internet. every one of them having some sort of graphic device, the graphic card. I assume I am not wrong if I say that all graphic cards today share as a common standard the textmode, which still uses 8 bit representation 16 colors, and as heritage all use as the default cp347.
Actually, you do assume wrong here :cool:
This is only true for "IBM PC compatibles", and only for historic reasons. There are different architectures around, most notably most tablets and mobile phones based on some embedded ARM platforms. So,
All I say is that I find a bit antagonistic the all modern unix like operating systems are still embracing this old concept of
terminal capabilities and what not, where those devices are long gone. Instead what we have is a fairly standard text device
(aka the textmode) which is the same on every computer. The terminal capabilities are always the same, you can safely assume that a program written for text mode will run and look alike on any system, even on raspberry pies.
this couldn't be farther from truth.

I do not even say that its a bad thing, let be historical devices be supported, why anger grandpa?
MGA/CGA/EGA/VGA is "grampa" here. Not in terms of actual age, but in terms of being outlived by changing requirements (see, distributed systems and interoperability). So, answering the rest of your post would be just repetition on my part, therefore I'll skip it ?
 
Getting my hands on some original old MS-DOS text files, I found there are more issues than just character encoding. These files use escape sequences implemented by the old ANSI.SYS driver to colorize the output, unfortunately they also use cursor positioning sequences which a modern terminal only executes in "raw" modes (so e.g. no way to view this through a pager like "less"). Furthermore, colors might be wrong as the default coloring is assumed to be gray on black.

Translating these files correctly to a "modern" representation sounds like a fun little side project, therefore I started to sketch something here: https://github.com/Zirias/dos2ansi/
 
They're still there, just typically not as dedicated hardware any more, but a piece of software instead.
So it is historical only kept alive by software
This is only true for "IBM PC compatibles", and only for historic reasons. There are different architectures around, most notably most tablets and mobile phones based on some embedded ARM platforms
Can we agree on the fact, that the wast majority (if not all of) the computers today, that do support hardware textmode, also support 8 bit 1:1 cp437 as default?
this couldn't be farther from truth.
Shall I understand this, that you think that a program assuming plainVGA textmode capabilities on modern hardware that supports hw textmode is mistaken?

VGA may be the grandpa, than what the piece of software we call terminal and what it is supporting is great great grandpa, and it is far more outlived, even by VGA
 
Can we agree on the fact, that the wast majority (if not all of) the computers today, that do support hardware textmode, also support 8 bit 1:1 cp437 as default?
"Hardware text mode" is a historic leftover by itself, so, this might or might not be true, but is just irrelevant for modern systems.

Shall I understand this, that you think that a program assuming plainVGA textmode capabilities on modern hardware that supports hw textmode is mistaken?
Yes.

VGA may be the grandpa, than what the piece of software we call terminal and what it is supporting is great great grandpa, and it is far more outlived, even by VGA
You're mixing up the concept of a text terminal (or even console) with the hardware offering a dedicated "text mode". The latter is dead for good, and the unix-style terminals survived that very well because they were designed in a flexible way (abstracting from the concrete hardware right from the beginning). Back in the days when hardware text-modes were a common thing, there were a lot of machines (micro-computers and home-computers) hardwiring their "terminal" to that hardware and CP437 was just the encoding and character set of one of those machine, so there was no way this could ever be interoperable.

Believe me, I can perfectly understand the fascination for "retro-computing", I'm one of those still programming the C64 for example :cool:. All I tell you: If you want to play with these historic (and proprietary) concepts, use an original machine (and OS). Or do what I started just above your answer and create some converters for files from back then, or any other emulation and compatibility fun ... ?
 
Back
Top