PDCurses
PDCurses copied to clipboard
Some minor changes
One feature per PR, please.
CP437 -- I don't think this is the right thing. I want to let users select their own code pages. I know the ACS characters only really match CP437, but there are a lot of other reasons someone might want a different CP. (I might consider multiple ACS maps, if useful.)
Flags -- will evaluate
Libname -- This is something that should be applied more broadly (across different compilers and platforms), or not at all. I should study this more.
I know the ACS characters only really match CP437
Microsoft now supports the 'original' VT escape sequences for the DEC special graphics character set. That doesn't give you all the ACS characters (just the VT100 ones plus a few others). But curses.h
warns you that the others are 'not well-supported by most terminals'.
Yeah, that's cool, but I'm thinking that all versions of Windows Terminal / Console that support the DEC set, already support Unicode, so you'd get the Unicode-defined versions of the ACS characters with just PDC_WIDE, without regard to the selected code page. The "narrow" version of wincon is mainly still useful for compatibility with (very) old Windows versions. I'm not sure there's a place for narrow + DEC. But... maybe?
Um. Yeah, you're right. Unicode support on Microsoft goes back a ways (XP and later, and on Win9x if UNICOWS is installed). Much further back than support for escape sequences.
I think there are still people using non-Unicode builds of WinCon, probably for compatibility with old code. They are the ones who will, say, set CP1251 and see their box characters turn into Russian (I tried this). We could safely say (for all platforms) : "Only use non-wide builds if you have to support really old forks of Windows".
Right now, we only display ACS characters using Unicode if PDC_WIDE
is #defined. We could do so if UNICODE
is #defined; i.e., if it's a non-wide build and Unicode is available, then display ACS characters using Unicode and 'ordinary' text using 8-bit-character functions. Do that, and even if you've selected a code page other that 437, the ACS characters will show up correctly.
If UNICODE
is not #defined, I think we're stuck with the current CP-437-only system, and most others are out of luck. Fortunately, pre-Unicode Windows is, as you say, (very) old.