This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin Termcap information involving extended ascii charicters

Hi all,

Short version as Egor writes:

Egor Duda <> writes:
> set cygwin default console mode to 'oem' by adding 'codepage:oem' to
> your CYGWIN variable [...]

Long version:

> >> what exactly do you mean by "extended ascii tables" here? if you
> >> mean characters with ascii codes 0x80-0xff then no special tty
> >> commands are needed to output them in cygwin console: cygwin
> >> console is 8-bit one.

There is no such thing as "extended ASCII".  ASCII is a seven-bit code
and pretty clearly defined today with very little variation.

There are quite a number of different 8-bit extensions of ASCII in use
today.  So to talk about a specific one, some more info is needed.

> UP> but this means that several programs that use the extended ascii charicters
> UP> by changing the charicter set will not, i.e. midnight commander, the colors
> UP> and function keys work, but the box and edge graphics wont show correctly,
> UP> is there any future plans to correct this?

IOW, you are talking about an 8-bit character set containing box
drawing characters.  That would most likely mean the IBM codepage 437
or the similar codepage 850.  These were used in DOS and they are used
on Windows in the command console.  They are called "OEM codepages" on
Windows as opposed to the "ANSI codepages" used by GUI programs and
the rest of the system.

> Your problem with mc arise from the fact that windows consoles have
> 2 modes -- ansi and oem.

Close but not quite.  There are APIs to set a windows console input
and output to any of the installed character sets.  This works fine on
NT and Windows 2000, but is severely restricted on Windows 9x/Me.
There is the user-level command CHCP to change this setting from the
command line.

By default the console is set to the OEM codepage, that is codepage
437 on american Windows and 850 on most european Windows versions.
These character sets contain the box drawing characters that mc would

On NT/2000 CHCP.COM can be used to set the console to the so-called
ANSI codepage (codepage 1252 on western versions of NT).  You also
need to select a compatible font, of course.  The "ANSI codepages" do
*not* contain box drawing characters.

> To  solve  your  problem  you  have  two   options. You can either set
> cygwin default console mode to 'oem' by  adding    'codepage:oem'   to
> your CYGWIN variable, or change acsc capability in terminfo entry.

This refers to an internal notion of Cygwin programs of the character
set used.  By default this is set to "codepage:ansi", probably because
of a widespread expectation that Latin-1 is the default on any
platform ;-).  When this internal character set is different from the
console character set, the console code in cygwin1.dll will convert
between these character sets.

This means that with the defaults, mc will output some character code
that it expects to mean a drawing character, but cygwin1.dll assumes
it means an ANSI codepage character (internal encodeing) and will
"convert" it to the appropriate OEM codepage character (console
encoding).  By setting CYGWIN=codepage:oem this conversion is
basically disabled, because than internal encoding == console

> UP> tables.. by standard its usually
> UP>     "\033[12m" and "\033[11m"
> UP> but that doesnt seem to work in cygwin... if you can tell me how
> UP> it

If these escape sequences are widespread (are they actually?), it may
be a good idea to implement them in Cygwin, the implementation itself
would be pretty straight forward.  Does anybody know where they are

so long, benny
ISION Internet AG
Benjamin Riefenstahl

Harburger Schlossstr. 1
D-21079 Hamburg

Want to unsubscribe from this list?
Check out:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]